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

Source map error in common-tags when building with webpack #140

Closed
joefiorini opened this issue Mar 8, 2018 · 1 comment
Closed

Source map error in common-tags when building with webpack #140

joefiorini opened this issue Mar 8, 2018 · 1 comment

Comments

@joefiorini
Copy link

joefiorini commented Mar 8, 2018

I feel a little bad posting this here, I'm not 100% convinced that common-tags is the problem, but it's the top of the stack trace, so here goes...

Occasionally our webpack build will start giving the following error:

 ERROR in ./node_modules/common-tags/lib/oneLine/index.js
    Module build failed: Error: /Users/joe/Code/lendinghome-treefuls/feature-1/node_modules/common-tags/lib/oneLine/index.js: original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
        at SourceMapGenerator_validateMapping [as _validateMapping] (/Users/joe/Code/lendinghome-treefuls/feature-1/client/src/monopack/node_modules/source-map/lib/source-map-generator.js:276:15)
        at SourceMapGenerator_addMapping [as addMapping] (/Users/joe/Code/lendinghome-treefuls/feature-1/client/src/monopack/node_modules/source-map/lib/source-map-generator.js:110:12)
        at /Users/joe/Code/lendinghome-treefuls/feature-1/client/src/monopack/node_modules/babel-core/lib/transformation/file/index.js:467:27

It happens with or without, hot module reload enabled and in between builds without ANY changes to node modules. The only solution is to remove all node_modules folders and try again. This happens at least three or four times a day to multiple devs on our team.

The only reason I'm suspicious of this library is because if I remove all uses of the oneLine tag, everything works again. Once I revert that change, it breaks immediately. I've googled it, and it seems like lot's of people run into this error with various libs (see mozilla/source-map#304, webpack/webpack-sources#28 and webpack/webpack#6131). We do not use the libraries listed in these issues.

I don't have the time right now, but I'll try to see if I can reproduce this in a separate repo. I'm posting this right now to gather data and see if anyone has this issue with common-tags in the stack trace. Or maybe if the maintainers here have any thoughts on whether or not this library is the root cause.

Thanks!

EDIT: Thought I'd add that our app is being transpiled with babel-runtime 6.26.0, and regerator-runtime 0.11.0. We are currently on common-tags 1.4.0, but I still saw this same issue after updating to the latest. Also, our webpack build has multiple entry points, not all of which use common-tags. If I remove the ones that DO use it, the build succeeds. As soon as I put them back, it fails again with the same error.

@fatfisz
Copy link
Collaborator

fatfisz commented Jun 1, 2018

According to webpack/webpack#6131 this is not even related to webpack, but rather babel-minify. Anyway, closing as this is not an issue with common-tags.

@fatfisz fatfisz closed this as completed Jun 1, 2018
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

No branches or pull requests

2 participants