`next/export` will not work with `Image` when using `unoptimized`
See original GitHub issueWhat version of Next.js are you using?
11.0.1
What version of Node.js are you using?
14.15.5
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
next export
Describe the Bug
When running next export
using the Image
from next/image
, I set the unoptimized
prop on Image
, but still get the following error meaning I cannot export my app.
Error: Image Optimization using Next.js' default loader is not compatible with `next export`.
Possible solutions:
- Use `next start` to run a server, which includes the Image Optimization API.
- Use any provider which supports Image Optimization (like Vercel).
- Configure a third-party loader in `next.config.js`.
- Use the `loader` prop for `next/image`.
Also, using normal JSX img gives error saying next/image
must be used instead.
Expected Behavior
next export
using next/image
will work when <Image unoptimized ... />
prop is added.
To Reproduce
Use Image
with unoptimized
set (to true) from next/image
and run next build && next export
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Error: Image Optimization using Next.js default loader is not ...
Error: Image Optimization using Next.js' default loader is not compatible with next export . Possible solutions: Use next start to run a server, ......
Read more >export-image-api - Next.js
You are attempting to run next export while importing the next/image component using the default loader configuration. However, the default loader relies on...
Read more >Deploy fails for next.js static export - Netlify Support Forums
I'm setting up a new Next.js project and can't get it to deploy for static export. I tried following the settings here: Framework ......
Read more >Image Optimization Through Next.js - Topcoder
When a request is received that matches a cached but expired file, the cached file is removed before a new optimized picture is...
Read more >Enable image optimization for static HTML export with Next.js
js does not support image optimization at build time and as there is no server, all of your images will be served unoptimized....
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
Closing as this has been resolved with
11.1
as mentioned above (no longer on canary channel, but stable) 👍Hi, it seems this issue is still ongoing for me and I have the latest version.
Error:
Image Optimization using Next.js' default loader is not compatible with
next export. Possible solutions: - Use
next startto run a server, which includes the Image Optimization API. - Use any provider which supports Image Optimization (like Vercel). - Configure a third-party loader in
next.config.js. - Use the
loaderprop for
next/image`.How can I solve this issue ?