-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Image optimizer rejects requests for remote images with _next/image in the URL (v14.2.7) #69456
Labels
bug
Issue was opened via the bug report template.
Image (next/image)
Related to Next.js Image Optimization.
locked
Comments
github-actions
bot
added
the
Image (next/image)
Related to Next.js Image Optimization.
label
Aug 29, 2024
styfle
added a commit
that referenced
this issue
Sep 3, 2024
…a Image component (#69586) ### What? Fixes #69456 which describes an issue with `next/image` component, where an external image containing `_next/image` in the URL fails with the error `"url" parameter cannot be recursive`. ### Why? The `next/image` component should be able to render images from configured hostnames without doing the recursive check. ### How? Before checking for the existence of `_next/image` substring in the image's path, we can simply check if the image is an external URL that comes from a preconfigured host in the `next.config.js` file. Example: <img width="1207" alt="image" src="https:/user-attachments/assets/8d5c99cf-f050-40a9-b5a4-ba961b83f037"> --------- Co-authored-by: Steven <[email protected]>
lubieowoce
pushed a commit
that referenced
this issue
Sep 4, 2024
…a Image component (#69586) ### What? Fixes #69456 which describes an issue with `next/image` component, where an external image containing `_next/image` in the URL fails with the error `"url" parameter cannot be recursive`. ### Why? The `next/image` component should be able to render images from configured hostnames without doing the recursive check. ### How? Before checking for the existence of `_next/image` substring in the image's path, we can simply check if the image is an external URL that comes from a preconfigured host in the `next.config.js` file. Example: <img width="1207" alt="image" src="https:/user-attachments/assets/8d5c99cf-f050-40a9-b5a4-ba961b83f037"> --------- Co-authored-by: Steven <[email protected]>
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
Issue was opened via the bug report template.
Image (next/image)
Related to Next.js Image Optimization.
locked
Link to the code that reproduces this issue
https://stackblitz.com/edit/nextjs-14-2-7-image-bug?file=app%2Fpage.tsx
To Reproduce
npm install && npm run dev
Current vs. Expected behavior
Image optimizer in v14.2.7 rejects image requests for remote images that contain
_next/image
in the URL path.Scenario:
_next/image
in their URL pathAs far as I can tell, this change comes from #68628
While I understand the need to avoid recursive image optimizer calls within the same app, the current implementation seems overly restrictive. Image optimizer should not reject requests for remote images specified in the
remotePatterns
as the app doesn't have control over what images are coming from an external CMS.Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 Available memory (MB): 32768 Available CPU cores: 12 Binaries: Node: 20.16.0 npm: 10.8.1 Yarn: N/A pnpm: N/A Relevant Packages: next: 14.2.7 // Latest available version is detected (14.2.7). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.4 Next.js Config: output: N/A
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 start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: