-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Using next/image adds blurwidth
and blurheight
attributes
#56511
Comments
Possibly related, the webpack SVG loader (in NextJS) does add this, no need to use next/image. This import: import shoulderslope from './shoulderslope.svg' Gives me this result {
src: "/_next/static/media/shoulderslope.a9c4f3f6.svg",
height: 1500,
width: 2000,
blurHeight: 0.
blurWidth: 0
} I got then spread the properties of that import into an <img {...importedSvg} /> That gave me the error about blurHeight and blurWidth not being valid, which in turn is how I found this issue. In my case, the fix was simply to not spread but only use what I needed: <img src={importedSvg.src} height={importedSvg.heigth} width={importedSvg.width} /> I wanted to share this here to clarify that this can bite you even when not using |
This removes the `blurHeight` and `blurWidth` props from the image tag in the MeasieImage component. These were added by the webpack SVG loader, and then spread into the image. For background, see: vercel/next.js#56511 (comment) This closes #5804
…lied - Also remove unnecessary props and add ones that could be needed - vercel/next.js#56511
Among the conversion and linting there are additional changes included: * Set proper useEffect deps * Header: Fix initial arrow animation (unnecessary animating happened under the Splash) * Header: Remove unnecessary animation props that didn't have effect and do minor animation tweaks * Header: Remove the marquee "transition" key since it isn't a variant * Header: Rename NavItem -> HeaderNavItem * Header: Fix useMedia ssr error * Fix vercel/next.js#65161 * Relocate locomotive-scroll wrapper to components with proper types * Add build step script for Vercel, not active currently * Figure: Don't spread props since the invalid blur* attrs could be applied (vercel/next.js#56511) * Figure: Remove unnecessary props and add ones that could be needed * Figure: Add alt text to video also * Tweak tokens * Slightly tweak some content strings and styles * Refactor unnecessary stuff away from useInView hook * Bunch of file extension changes and sort tweaks * Relocate and fix component script * Sort keys, jsx props and destructured keys * Sitemap: Better key for projects * utility.js -> utils.ts
I'm able to reproduce the same problem, using the setup according to the documentation. The imported image has the The NextJS versión I'm using is 14.2.7. |
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/zen-surf-33vcdj?file=%2Fpages%2Findex.tsx%3A2%2C46
To Reproduce
img
element.Current vs. Expected behavior
There should be no unsupported attributes added to the IMG tag
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Image optimization (next/image, next/legacy/image)
Additional context
It's been around since next@12 initial next/image I believe.
The text was updated successfully, but these errors were encountered: