Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Elir-Mahad opened this issue Jan 12, 2022 · 0 comments
Open

Comments

@Elir-Mahad
Copy link

Elir-Mahad commented Jan 12, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant