-
-
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
Wrong detection of a sourcemap entry when it's just a string #3670
Comments
This has been fixed for Parcel 2, not entirely sure if we'll fix it for Parcel 1 |
(Duplicate of #2408) |
On this one -- is there a workaround for the time until Parcel 2 is released? I just ran into this in another project (@json-editor/json-editor) where Parcel is choking on a source map string. I'd try bumping my project to Parcel 2, but there doesn't appear to be a Parcel 2 release available on |
@TimMensch it's under the |
Great, thanks! |
🐛 bug report
Parcel detects sourcemaps in JS files when they're inside JS code strings and aren't actually sourcemaps.
🎛 Configuration (.babelrc, package.json, cli command)
Parcel 1.12.4, vue-notification 1.3.16, no configurations otherwise
🤔 Expected Behavior
Parcel correctly bundles the code included in vue-notification like Webpack etc do
😯 Current Behavior
vue-notification has the following line in dist/index.js (don't know if it's normal that Parcel loads a dist/js file instead of going to the source, this line is from some dependency of vue-notification):
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
This causes Parcel to assume it's a sourcemap while it's actually just text inside a string in code that outputs sourcemaps. Error goes away if I break it up, for example
css += '\n/*# sourceMap'+'pingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
error message:
💁 Possible Solution
🔦 Context
💻 Code Sample
import vue-notification in a project, run Parcel on it
🌍 Your Environment
The text was updated successfully, but these errors were encountered: