Broken with babel-register source mapping
See original GitHub issueI’m trying to run something like so:
require('babel-register')
// Do stuff
It only works with --no-source-maps
. I’m getting this error:
/home/dev/W/app/index.js
/home/dev/W/app/node_modules/babel-register/lib/node.js
/home/dev/W/app/node_modules/babel-core/index.js
/home/dev/W/app/node_modules/babel-core/lib/api/node.js
/home/dev/W/app/node_modules/babel-core/lib/transformation/file/index.js
/home/dev/W/app/node_modules/convert-source-map/index.js
An error occurred while trying to read the map file at node_modules/convert-source-map/foo.js.map
Error: ENOENT: no such file or directory, open 'node_modules/convert-source-map/foo.js.map'
Using this babelrc:
{
"presets": ["es2015-node5"],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"add-module-exports",
[
"transform-async-to-module-method",
{ "module": "bluebird", "method": "coroutine" }
]
]
}
Using node v5.12
├─┬ babel-preset-es2015@6.9.0
│ └─┬ babel-plugin-transform-regenerator@6.9.0
│ └─┬ babel-core@6.10.4
│ └── babel-register@6.9.0
└── babel-register@6.8.0
Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:6
Top Results From Across the Web
Chrome source maps not working with Babel - Stack Overflow
Chrome says "Source Map detected" but no dice. I'm using Babel6, Node 6.5 and new --inspect with Chrome DevTools. I think I've spent...
Read more >4 Reasons Why Your Source Maps are Broken - Sentry Blog
Bad source maps caused by multiple transformations ... If you're using two or more JavaScript compilers invoked separately (e.g., Babel + UglifyJS) ...
Read more >babel-loader - webpack
This package allows transpiling JavaScript files using Babel and webpack. ... you might be transforming the node_modules folder or other unwanted source.
Read more >Nodemon + Babel + VSCode - Michele Titolo
sourceMaps - VSCode needs to know about source maps. If this setting, or the one in package.json , is missing then you'll get...
Read more >Babel Roadmap
We would like to release Babel as a pure ESM package. We are now in the process of converting our sources to be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is an issue with
thlorenz/convert-source-map
.What’s happening is that both
devtool
andbabel-core
depend onconvert-source-map
. This causes the source map converter to parse itself. This shouldn’t be a problem, except there is a comment inconvert-source-map/index.js
that has a fakesourceMappingURL
.Just remove this line to fix it. 👍
There are 3 ways to go about this:
babel-core/node_modules/convert-source-map
anddevtool/node_modules/convert-source-map
. NOTE: This will be overwritten if you reinstall either package.convert-source-map
, remove the comment, forkbabel-core
anddevtool
and make them depend on your fork ofconvert-source-map
. 😢babel-core
anddevtool
).Aw damn it 😦 just found this tool and this caught me right off the bat. I need sourcemaps to be there, can’t really do without them. Hopefully the source map folks get time to make a fix.