Property overrideSrc of image component (next/image) does not override srcset property #65432
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/quirky-feistel-76hgmy?file=%2Fpages%2Findex.tsx%3A9%2C19
To Reproduce
Set the property overrideSrc as described in the docs https://nextjs.org/docs/app/api-reference/components/image#overridesrc
Both in dev and build the srcset property of the image won't be overridden.
Current vs. Expected behavior
Current:
The accessToken is being exposed in srcset!
Expected:
To be srcset property rewritten to bg.jpg
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 18.20.2 npm: 10.5.0 Yarn: N/A pnpm: N/A Relevant Packages: next: 14.2.3 // Latest available version is detected (14.2.3). eslint-config-next: 14.2.3 react: 18.3.1 react-dom: 18.3.1 typescript: 5.4.5 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 build (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: