Hacker News new | ask | show | jobs
by Kevcmk 1158 days ago
Which one, the go ahead and "define your own custom loader"? You mean re-implement the image export that is sitting right there in their express server... from scratch? Hah.

NextJS won't let you export their optimized images in a static site export because they want _everything_ running through their Express server.

Why's that great for them? Because they get to charge you for image bandwidth and image optimization. This is called vendor lock in.

Sources:

In vivo (v13.3.0):

  > npx next export
  <...>
  error - Image Optimization using the default loader is not compatible with export.
    Possible solutions:
      - Use `next start` to run a server, which includes the Image Optimization API.
      - Configure `images.unoptimized = true` in `next.config.js` to disable the Image Optimization API.
    Read more: https://nextjs.org/docs/messages/export-image-api
and https://vercel.com/changelog/changes-to-vercel-image-optimiz...
1 comments

To be fair, you can optimize images yourself, or just not optimize them at all.
Or use a web framework that gives you optimised images that aren’t vendor-locked.

The point is that the library artificially limits capability because it benefits a particular vendor model, not the user.