image optimizer returns 400 when path contains unicode characters
See original GitHub issueWhat version of Next.js are you using?
11.0.1
What version of Node.js are you using?
14.17.2
What browser are you using?
firefox
What operating system are you using?
ubuntu
How are you deploying your application?
vercel
Describe the Bug
in a production build, the image optimizer returns with status code 400, and error message “The requested resource isn’t a valid image” when the image src contains non-ascii unicode characters.
Expected Behavior
image optimizer should handle paths with all allowed unicode characters
To Reproduce
- clone https://github.com/stefanprobst/issue-next-image-optimizer and
yarn install
- run
yarn build && yarn start
- there should be an image visible at http://localhost:3000, but there isn’t. the network panel reports status code 400, error message “The requested resource isn’t a valid image.” which comes from here
- note that when running
yarn dev
the image is visible
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (20 by maintainers)
Top Results From Across the Web
How do I read an image from a path with Unicode characters?
It can be done by. opening the file using open() , which supports Unicode as in the linked answer,; read the contents as...
Read more >Filename encoding and interoperability problems
Unicode errors for valid Unicode filepaths can be caused by lack of Python locale configuration on Linux and Mac OSes. If your file...
Read more >Paths — SVG 2
A path is defined by including a 'path' element on which the d property specifies the path data. The path data contains the...
Read more >Responsive images - web.dev
When adding icons to your page, use SVG icons where possible or in some cases, unicode characters. Summary #. Use SVG or unicode...
Read more >Overlay - ImageKit.io Docs
However it could be possible that you have overlay images stored within a specific folder, in that case there will be slashes (...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The fix is available in v11.0.2-canary.25
You can try it out with
yarn add next@canary
, thanks!sure, done in #27671