Skip to content

image optimizer returns 400 when path contains unicode characters #27210

@stefanprobst

Description

@stefanprobst

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions