question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

image optimizer returns 400 when path contains unicode characters

See original GitHub issue

What 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

  1. clone https://github.com/stefanprobst/issue-next-image-optimizer and yarn install
  2. run yarn build && yarn start
  3. 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
  4. note that when running yarn dev the image is visible

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
styflecommented, Aug 3, 2021

The fix is available in v11.0.2-canary.25

You can try it out with yarn add next@canary, thanks!

1reaction
stefanprobstcommented, Aug 2, 2021

sure, done in #27671

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found