create-react-app: images with non-ascii names don't appear in dev mode

Can you reproduce the problem with latest npm?

Yes.

Description

In dev mode, images in src which are imported and have non-ascii characters in their names are not loaded. The problem does not appear in production builds

Expected behavior

Tell us what you think should happen.

Actual behavior

Tell us what actually happens.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):

    react-scripts@0.8.5

  2. node -v:

    v7.1.0

  3. npm -v:

    4.0.2

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version: Edge, Firefox, Chrome

Reproducible Demo

https://github.com/vgrigoriu/diacriticsInFilenames/

Just yarn start to see the issue. There are two identical images, one named Petiole.jpg (which works just fine) and one named Pétiole.jpg which doesn’t load. I noticed that this doesn’t happen for smaller images, which are converted to data urls.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

I confirmed that it is indeed fixed with webpack-dev-middleware 1.10.1. Thanks everyone for your help.

Okay, found the issue in webpack-dev-middleware and released a new version. Thanks @vgrigoriu for providing a repository, that really helped with narrowing down the issue quickly (I wish everyone would do that 😄 ).

It seems to have exactly the same behavior as before. The img with diacritics generates a url like http://localhost:3000/static/media/Pétiole.f885429e.jpg, but the development server returns the home page for it.