imagemin-svgo introduced a breaking change with the latest version 10.0.0 which breaks compatibility with next-optimized-images. They switched from CommonJS Modules to ESM.
> Build error occurred
122Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: .../node_modules/imagemin-svgo/index.js
123require() of ES modules is not supported.
124require() of .../node_modules/imagemin-svgo/index.js from .../node_modules/next-optimized-images/lib/loaders/img-loader.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
125Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from .../node_modules/imagemin-svgo/package.json.
imagemin-svgo
introduced a breaking change with the latest version 10.0.0 which breaks compatibility withnext-optimized-images
. They switched from CommonJS Modules to ESM.Related issue from the library: https://github.com/imagemin/imagemin-svgo/issues/51