Parcel with source maps enabled cannot import LiveScript
See original GitHub issue🐛 bug report
Parcel with source maps enabled cannot import LiveScript
🎛 Configuration (.babelrc, package.json, cli command)
{
"name": "livescript-parcel",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel build index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"livescript": "^1.6.0",
"parcel-bundler": "^1.10.3"
}
}
🤔 Expected Behavior
import livescript from 'livescript'
should work
😯 Current Behavior
> parcel build index.js
⚠️ Could not load existing sourcemap of "node_modules/livescript/lib/index.js".
🚨 livescript-parcel/node_modules/livescript/lib/index.js:69:43: Expecting Unicode escape sequence \uXXXX (69:43)
67 | if ((ref$ = options.map) === 'linked' || ref$ === 'debug') {
68 | mapPath = path.basename(outputFilename) + ".map";
> 69 | result.code += "\n + mapPath + "\n";
| ^
70 | } else {
71 | result.code += "\n//# sourceMappingURL=data:application/json;base64," + bufferFrom(result.map.toString()).toString('base64') + "\n";
72 | }
It appears that parcel is incorrectly interpreting the file as a source map.
if ((ref$ = options.map) === 'linked' || ref$ === 'debug') {
mapPath = path.basename(outputFilename) + ".map";
result.code += "\n//# sourceMappingURL=" + mapPath + "\n";
} else {
result.code += "\n//# sourceMappingURL=data:application/json;base64," + bufferFrom(result.map.toString()).toString('base64') + "\n";
}
💻 Code Sample
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:23 (8 by maintainers)
Top Results From Across the Web
Source Maps - Parcel
Below is an example covering all ways of adding mappings to a SourceMap instance: import SourceMap from '@parcel/source-map'; let sourcemap = new SourceMap( ......
Read more >Source Maps - Rollbar Docs
Benefits of providing your source maps to Rollbar include: Stack traces ... Source maps are automatically enabled in your project, but you still...
Read more >source-map-support - npm
Start using source-map-support in your project by running `npm i ... Instead of: import sourceMapSupport from 'source-map-support' ...
Read more >Use a source map — Firefox Source Docs documentation
The JavaScript sources executed by the browser are often transformed in some way from the ... To enable the debugger to work with...
Read more >source-map-loader - webpack
Disclaimer: source-map-loader is a third-party package maintained by community members, it potentially does not have the same support, security policy or ...
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
Two fixes :
\n
from strings in the package sources (node_modules/paper/dist/paper-full.js
in my case)parcel index.html --no-source-maps
Is there a better solution?
This is still an issue with 1.x.