Closed MXXXXXS closed 2 years ago
toString
and toJSON
returns string, don't think you are right here
@alexander-akait Strange... toJSON
actually returns an object
And babel-loader not recognise string, it should be an object
Please create reproducible test repo, babel-loader should handle string source maps (as minimum it worker early)
@alexander-akait Here is: https://github.com/MXXXXXS/imports-loader-bug
Run npm i && npm run build
, and it will output like:
ERROR in ./src/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: .inputSourceMap must be a boolean, object, or undefined
at assertInputSourceMap (/home/aqua/coding/import-loader-bug/node_modules/@babel/core/lib/config/validation/option-assertions.js:124:11)
Confirmed the above patch fixes this issue for us.
https://github.com/webpack-contrib/imports-loader/blob/1d8f8c3ce401ac7b415863e0e658ebdb8ec489fb/src/index.js#L106
https://github.com/babel/babel/pull/14658
It will cause error when using with babel-loader like