Closed realav closed 3 years ago
Hi @legendaryaman, unfortunately I am not supporting next-optimized-image
as we are using the next/image
component and it has not been updated in over a year. Will leave the issue open if someone has experience integrating this repo with next-optimized-image
and would like to chime in.
I just found out that the Image component is very nicely integrated.
This allows an easy switch between the NextImage component and the plain<img>
tag
I just have to change the tag in /components/Image.js
import NextImage from 'next/image'
// eslint-disable-next-line jsx-a11y/alt-text
const Image = ({ ...rest }) => <NextImage {...rest} />
export default Image
To
//import NextImage from 'next/image'
// eslint-disable-next-line jsx-a11y/alt-text
const Image = ({ ...rest }) => <img {...rest} />
export default Image
For anyone who is getting this common error message:
Image Optimization using Next.js' default loader is not compatible with
next export
Just use the normal <img>
component in Image.js for Next Static exports
Ah, I thought you have already changed that setting. Yes, you can't use the next/image
component for static export.
Describe the bug
I am getting this error when using next-optimized-images for my project to enable static exports. Any idea what's causing this?
Package.json
System Info (if dev / build issue):
Additional context Add any other context about the problem here.