Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

images with non-ascii names don't appear in dev mode #1396

Closed
vgrigoriu opened this issue Jan 16, 2017 · 18 comments
Closed

images with non-ascii names don't appear in dev mode #1396

vgrigoriu opened this issue Jan 16, 2017 · 18 comments

Comments

@vgrigoriu
Copy link

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.

@gaearon
Copy link
Contributor

gaearon commented Jan 16, 2017

Thanks for reporting. Likely a bug in Webpack.
In the meantime please use ASCII for filenames when possible.

@gaearon gaearon added this to the 0.9.1 milestone Feb 11, 2017
@gaearon
Copy link
Contributor

gaearon commented Feb 11, 2017

Tagging as 0.9.1—not because we'll fix it, but because we should at least report it upstream to the project causing it, whether Webpack or something else. Once we report it I'm happy to untag it.

@Timer
Copy link
Contributor

Timer commented Feb 11, 2017

We'll have to test if webpack 2 fixes this.

@Timer
Copy link
Contributor

Timer commented Feb 12, 2017

@vgrigoriu can you test if master fixes this?

@vgrigoriu
Copy link
Author

Can you point me at instructions on how to use master?

@gaearon
Copy link
Contributor

gaearon commented Feb 13, 2017

You can clone the project, run npm install and npm start. This will run the development server with the default template. You can then edit it in packages/react-scripts/template.

@vgrigoriu
Copy link
Author

Thanks, I'll give it a try and let you know.

@vgrigoriu
Copy link
Author

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

@gaearon
Copy link
Contributor

gaearon commented Feb 13, 2017

Would you like to help us by filing a bug in Webpack?

@Timer
Copy link
Contributor

Timer commented Feb 15, 2017

We can ping @bebraw if he's not too busy and ask if he has a suggestion or reason for this (he cut the last release for file-loader). Thanks in advance!

@bebraw
Copy link

bebraw commented Feb 15, 2017

Hi,

I forwarded this to @SpaceK33z as he knows more about WDS. It might be something there.

@vgrigoriu
Copy link
Author

Should I still open the bug in Webpack?

@bebraw
Copy link

bebraw commented Feb 15, 2017

Maybe better wait for @SpaceK33z to comment, but do as you want. 👍

@SpaceK33z
Copy link
Contributor

Just a note that I haven't forgotten this, it's on my list to research soon. It's probably a bug in webpack-dev-middleware.

@SpaceK33z
Copy link
Contributor

SpaceK33z commented Feb 18, 2017

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 😄 ).

@gaearon
Copy link
Contributor

gaearon commented Feb 18, 2017

Since this is a transitive dependency, I’m guessing we can close this. New installs shouldn’t have this problem.

@gaearon gaearon closed this as completed Feb 18, 2017
@gaearon
Copy link
Contributor

gaearon commented Feb 18, 2017

@vgrigoriu Thanks for reporting.
@SpaceK33z Thanks for fixing.

@vgrigoriu
Copy link
Author

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

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants