cyrilwanner / next-optimized-images

🌅 next-optimized-images automatically optimizes images used in next.js projects (jpeg, png, svg, webp and gif).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem when using next.js github pages template + next-optimized-images

Elir-Mahad opened this issue · comments

Greetings,

I'm using the next.js github pages template.

I have a some png image files that i'm trying to deploy, but i ran into this 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`.

I came across your repo and I installed your package and this package https://www.npmjs.com/package/imagemin-optipng

What exactly am i supposed to put in my config. I followed the documentation but i wasn't able to make it work.

My next.config looks like this:

const debug = process.env.NODE_ENV !== "production";

module.exports = {
  assetPrefix: !debug ? "/notes/" : "",

};

Please help