Next12.2 future/image support
See original GitHub issueDescribe the bug
Using the experimental “allowFutureImage” with storybook, it throw Error.
The "next/future/image" component is experimental and may be subject to breaking changes. To enable this experiment, please include `experimental: { images: { allowFutureImage: true } }` in your next.config.js file.
Your minimal, reproducible example
nextjs example with-storybook-app
Steps to reproduce
npx create-next-app --example with-storybook with-storybook-app- add experimental config
// next.config.js
module.exports = {
...
experimental: {
images: {
allowFutureImage: true,
},
},
}
- replace “next/image” to “next/future/image”
// pages/nextjsImages.js
import Image from 'next/future/image'
Expected behavior
with next.config.js setup, the stories including future/image should load without error.
How often does this bug happen?
Every time
Screenshots or Videos
Platform
- mac OS
- Chrome (102.0.5005.115)
storybook-addon-next version
1.6.7
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:20
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Blog - Next.js 12.2
Improvements to next/image : Including a new next/future/image ... Next.js now also supports using the Edge Runtime for API Routes.
Read more >How to Use the New <next/image> Component
Next.js 12.2 includes a totally revised component for image optimization. Let's see what has changed.
Read more >Next.js automatic image optimization with next/image
Learn about automatic image optimization and how it can benefit developers with the native, game-changing, and powerful next/image API.
Read more >Enable styling of next/image outer wrapper #22861 - GitHub
g-elwell asked this question in Help ... There also seems to be a lack of support for <style jsx> className styles ... https://nextjs.org/blog/next-12-2...
Read more >How to enable NextJS "next/future/image"? - Stack Overflow
For Next v13 users: I believe next/future/image is now the default Image component. So no additional work necessary! Just import and use
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Workaround with support of fill property from
v12.2.4I think this is the simplest solution.