-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Parcel with source maps enabled cannot import LiveScript #2408
Comments
I guess the source map detection should check if it's at the end of the file (as in: there are no non-whitespace characters after the comment)
parcel/packages/core/parcel-bundler/src/assets/JSAsset.js Lines 85 to 91 in 060db2e
|
Maybe could - as proposed by @mischnic check for the beginning & end of // either start or end with SOURCEMAP_RE
// full regex: /^\s*\/\/\s*[@#]\s*sourceMappingURL\s*=\s*([^\s]+)|\/\/\s*[@#]\s*sourceMappingURL\s*=\s*([^\s]+)\s*$/;
^\s*SOURCEMAP_RE|SOURCEMAP_RE\s*$ Means - sourcemaps can't be referenced somewhere in the middle of the bundle. How do people feel about that? |
That is not supported, so it should be fine. The spec (Google Document (!)) says:
So adding |
Ok, that sounds good enough. Would you like to open a PR? If busy, I can do too. |
Go ahead! |
Same issue with TypeScript. The line in dependency: sourceMap && (css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"); have transformed to sourceMap && (css += "\n + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"); Part of the string and the quote was cut |
Can we get a release cut with this fix before 2.0? We aren't able to compile with source maps which is making debugging difficult. I'd like to avoid forking and cherry-picking the fix |
This just bit me when importing |
Seems to me it could at least have been fixed in the current release. We just tried to move our project to parcel and were greeted to this purposely not-fixed error. |
Is there a way to disable sourcemaps for a single module? |
@eranimo No |
I'm running to the same issue using "onfido-sdk-ui". Tried with erver running at http://localhost:1234 |
I am having this issue as well with the video-react package
|
Same issue with paper.js:
|
Two fixes :
Is there a better solution? |
Is there going to be a fix for this in a pre 2.0 release? I'd like to NOT disable sourcemaps since they are providing us with some useful context in our logs when errors occur in our application. If you don't have plans for a fix, then I need to start making plans as to whether or not to upgrade our parcel bundler to 2.0. I know you are working on documentation still for 2.0 but I just assume that upgrade path is not going to be simple. |
Ran into this issue with an imported React component that was bundled with webpack. Especially unfortunate because I had to use webpack to bundle that component in the first place because of #3305 On the plus side, the (I frigging love Parcel btw, I wish I could use it all the time for everything!) |
I add But it's needed for development. |
@medmin does it work in Parcel 2? I think we fixed this. |
@DeMoorJasper I think I've encountered the same problem. Update to Parcel 2 worked for me. The code sample (https://github.com/raine/livescript-parcel) runs for me without build errors, when I use Parcel 2. 🐛 Bug ReportParcel with source maps enabled cannot import ckeditor5 Editor 🎛 Configuration (.babelrc, package.json, cli command){
"name": "parcel-ckeditor",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel build index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"@ckeditor/ckeditor5-build-classic": "^20.0.0",
"@ckeditor/ckeditor5-react": "^2.1.0",
"parcel-bundler": "^1.12.4",
"react": "^16.13.1",
"react-dom": "^16.13.1"
}
} 🤔 Expected Behavior
😯 Current Behavior
💁 Possible SolutionUse Parcel 2 npm install -D parcel@next 🌍 Environment
|
@chhch please open a seperate bug report for that, that doesn't actually seem like a sourcemap bug though |
i'm sorry to say @DeMoorJasper but this is not fixed in 1.x versions. adding the |
This is still an issue with 1.x. |
As always frontend dev is convoluted. parcel v1 doesn't play nicely with vue: parcel-bundler/parcel#2408 so we would need to disable source maps. But that'll slow down dev, so we migrate to v2. That comes with its own baggage, but hopefully it'll be the lesser of the two evils.
🐛 bug report
Parcel with source maps enabled cannot import LiveScript
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
import livescript from 'livescript'
should work😯 Current Behavior
It appears that parcel is incorrectly interpreting the file as a source map.
💻 Code Sample
https://github.com/raine/livescript-parcel
The text was updated successfully, but these errors were encountered: