Skip to content

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

Description

@hank-cmd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions