-
-
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
🐛 watch
generates invalid bundles
#3472
Comments
Multiple entry points should be supported by #1119 |
I've seen the same issue and worked around the issue by disabling HMR. It seems the HMR code is producing invalid JS for the first compile. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
Thanks for the notice! After a quick look at your issue, I believe they are connected. I can confirm, as you can see in the reproduction repository, that the basenames of the entry files are the same. I'm not using parcel with this configuration anymore. I figured that it's not how parcel is intended to be used. One should rather provide it a single ( |
Thanks for the confirmation, @jdoubleu! |
🐛 bug report
When I run the
watch
command (npm run dev
in my case), parcel sometimes generates invalid bundles.🎛 Configuration (.babelrc, package.json, cli command)
package.json
:.babelrc
: none🤔 Expected Behavior
The bundle created by the
watch
command generates JavaScript code without any errors.😯 Current Behavior
The JavaScript console prints an error message (e.g. TypeError), because the bundle contains invalid code. It looks like a new file is added inside the bundle (compare code below).
💁 Possible Solution
When I change the file while watching, the error disappears and is not reproducible in the future. However if I restart the
watch
command, the issue appears again, even with the latest modifications which have previously worked while watching the files.🔦 Context
💻 Code Sample
Repository: https://github.com/jdoubleu/parcel-bug-3472
assets/app.js
:dist/app.js
:Notice the code after the source map here. This does not look right and seems to be the content of another file not from the start.
After changing the source file while watching, as described above, the
dist/app.js
looks totally different at the same position in file:🌍 Your Environment
The text was updated successfully, but these errors were encountered: