NextNodeServer handleNextImageRequest doens't work as expected with assetPrefix and custom next/image loader #65980
Labels
bug
Issue was opened via the bug report template.
Image (next/image)
Related to Next.js Image Optimization.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/friendly-montalcini-mc6sg6
To Reproduce
Current vs. Expected behavior
Image should be shown correctly.
Provide environment information
Which area(s) are affected? (Select all that apply)
Image (next/image)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
#52492 This pull request not just separated routing code from render servers, but changed how next/image requests are recognized. Before, using regex matched if there is
/_next/image
in path. But nowparsedUrl.pathname
needs explicitly to start with/_next/image
. But when i18n is enabled in next config, nowparsedUrl.pathname
starts with/{locale}/{assetPrefix}/_next/image
and failsparsedUrl.pathname.startsWith('/_next/image')
The text was updated successfully, but these errors were encountered: