Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This line toString should be toJSON #141

Closed
MXXXXXS opened this issue Jul 12, 2022 · 5 comments · Fixed by #146
Closed

This line toString should be toJSON #141

MXXXXXS opened this issue Jul 12, 2022 · 5 comments · Fixed by #146

Comments

@MXXXXXS
Copy link

MXXXXXS commented Jul 12, 2022

generator.toString()

babel/babel#14658

It will cause error when using with babel-loader like

Error: .inputSourceMap must be a boolean, object, or undefined
    at assertInputSourceMap (/home/aqua/coding/atri/node_modules/@babel/core/lib/config/validation/option-assertions.js:124:11)
@alexander-akait
Copy link
Member

toString and toJSON returns string, don't think you are right here

@MXXXXXS
Copy link
Author

MXXXXXS commented Jul 13, 2022

image

@alexander-akait Strange... toJSON actually returns an object

And babel-loader not recognise string, it should be an object

@alexander-akait
Copy link
Member

Please create reproducible test repo, babel-loader should handle string source maps (as minimum it worker early)

@MXXXXXS
Copy link
Author

MXXXXXS commented Jul 14, 2022

@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)

@rectalogic
Copy link

Confirmed the above patch fixes this issue for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants