-
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
Could not use next/future/image
with imported image and fill layout
#39807
Comments
I have identified the issue. The static imported image will always have I am already working on a fix to let Next.js ignore |
Fixes #39807. When statically importing an image, the `width` and `height` will always be provided alongside the `src` by the Webpack. `next/image` will ignore `width` and `height` come from Webpack when `layout === 'fill'`, while `next/future/image` will not, hence the issue. The PR fixes that. The corresponding integration test cases are also added. cc @styfle ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
When using an imported image and the fill layout with the new image component it throw an error:
Expected Behavior
The doc seems to allow this use case. So we should be able to use the fill layout with an imported image.
Link to reproduction
https://stackblitz.com/edit/nextjs-future-image-fill-bug?file=pages/index.js
To Reproduce
Open the sand box
The text was updated successfully, but these errors were encountered: