The concat-text-webpack-plugin is nested deep in some package, and errors when I have NextJS and Node 18.
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=8 <=16". Got "18.16.0"
error Found incompatible module.
It's fine with Node 16. Looking into the package code there is a line
"engines": {
"node": ">=8 <=16"
},
which blocks using Node 18+. The repo is archived and cannot be PR'd.
How can I use this with Node 18+?
This lead me down a rabbit hole and I have come out a much better developer. I forked the repo, and rewrote the tests to work with Node 18+ and Webpack 5. The tests relied on some knarly behaviour of webpack which was completely removed from v4 => v5.
I published a package here https://www.npmjs.com/package/concat-text-webpack-plugin-2023
The key bit is that the original package is regularly a nested dependency. This new version has the same API as the original and has included README on how to make the resolutions work with nested deps.