Closed
Description
I think this change nodejs/node#39175 in node 16.6 means the webpack.config.js is loading is broken for ESM projects.
Our CI started failing once node 16.6 got rolled out with:
$ npm run build
> @web3-storage/api@3.1.1 build
> webpack
TypeError: String.prototype.startsWith called on null or undefined
at startsWith (<anonymous>)
at node:internal/errors:811:19
at Array.filter (<anonymous>)
at node:internal/errors:809:16
at prepareStackTrace (node:internal/errors:96:12)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:38)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
Setting WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG=true
fixed it, but it seems like a workaround.
see:
webpack-cli/packages/webpack-cli/lib/webpack-cli.js
Lines 50 to 51 in a660ffc
see: nodejs/node#39175
see: nodejs/node@e2a6399#r54198959