What is the problem?
Next export which would be required to deploy on some providers does not work out of the box due to use of next/image component within Blitz.
When doing next export after a blitz build, we get the following error, even though personally not making use of either the Blitz Image component or the Next Image component with the application.
Error: Image Optimization using Next.js' default loader is not compatible with next export.
Possible solutions:
- Use next start, which starts the Image Optimization API.
- Use Vercel to deploy, which supports Image Optimization.
- Configure a third-party loader in next.config.js.
Read more: https://err.sh/next.js/export-image-api
What are detailed steps to reproduce this?
1.Create a fresh Blitz application.
2. add next export to "build" in package.json ("build": "blitz build && next export").
3. npm run build in console.
Run blitz -v and paste the output here:
You are using beta software - if you have any problems, please open an issue here:
https://github.com/blitz-js/blitz/issues/new/choose
Windows 10 | win32-x64 | Node: v14.15.4
blitz: 0.30.5 (global)
blitz: 0.30.5 (local)
Package manager: npm
System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Memory: 18.57 GB / 31.94 GB
Binaries:
Node: 14.15.4 - D:\Code\Node\node.EXE
Yarn: Not Found
npm: 7.6.0 - D:\Code\Node\npm.CMD
Watchman: Not Found
npmPackages:
@prisma/client: ~2.17 => 2.17.0
blitz: 0.30.5 => 0.30.5
prisma: ~2.17 => 2.17.0
react: 0.0.0-experimental-3310209d0 => 0.0.0-experimental-3310209d0
react-dom: 0.0.0-experimental-3310209d0 => 0.0.0-experimental-3310209d0
typescript: 4.2.2 => 4.2.2
What is the problem?
Next export which would be required to deploy on some providers does not work out of the box due to use of
next/imagecomponent within Blitz.When doing next export after a blitz build, we get the following error, even though personally not making use of either the Blitz Image component or the Next Image component with the application.
Error: Image Optimization using Next.js' default loader is not compatible with
next export.Possible solutions:
- Use
next start, which starts the Image Optimization API.- Use Vercel to deploy, which supports Image Optimization.
- Configure a third-party loader in
next.config.js.Read more: https://err.sh/next.js/export-image-api
What are detailed steps to reproduce this?
1.Create a fresh Blitz application.
2. add
next exportto "build" in package.json ("build": "blitz build && next export").3. npm run build in console.
Run
blitz -vand paste the output here:You are using beta software - if you have any problems, please open an issue here:
https://github.com/blitz-js/blitz/issues/new/choose
Windows 10 | win32-x64 | Node: v14.15.4
blitz: 0.30.5 (global)
blitz: 0.30.5 (local)
Package manager: npm
System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Memory: 18.57 GB / 31.94 GB
Binaries:
Node: 14.15.4 - D:\Code\Node\node.EXE
Yarn: Not Found
npm: 7.6.0 - D:\Code\Node\npm.CMD
Watchman: Not Found
npmPackages:
@prisma/client: ~2.17 => 2.17.0
blitz: 0.30.5 => 0.30.5
prisma: ~2.17 => 2.17.0
react: 0.0.0-experimental-3310209d0 => 0.0.0-experimental-3310209d0
react-dom: 0.0.0-experimental-3310209d0 => 0.0.0-experimental-3310209d0
typescript: 4.2.2 => 4.2.2