-
-
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
2.6.1 - 2.6.2: build error @parcel/compressor-raw: Cannot read properties of undefined (reading 'on') #8257
Comments
Maybe a weird dependency issue? Try deleting your lock file and node_modules and reinstalling. |
Can't really provide a reproduction as I'm not fully sure why it happens on our build. Attaching a screenshot of the error received. Not always the same file that throws the error and sometimes build succeeds. Tried deleting parcel cache, node modules, package-lock.json and reinstalling and trying again multiple times. |
I just started a parcel project, and I'm having the same issue. I can't say the exact steps to reproduce, since, as it's happening to you, sometimes it builds, sometimes it gives me this error. However, I think it's not related to JS itself because it happens when I modify even a single letter on the main HTML file. |
@EduMenges Are you also using Windows? |
@mischnic Yes, I'm using Windows 10. I rolled back to 2.6.0 and no longer got this error. |
I rollback parcel to version 2.6.0. I also got No Errors and it is working fine. |
Just to point out that I don't think it's Windows related: I've tried this on WSL2 / Ubuntu as well, deleting all node_modules and cache and running |
This is quite annoying.. and very inconsistent. I feel like when it starts to happen, if I just keep running it over and over (and getting this error over and over) it eventually fixes itself. Running parcel 2.6.2 on Windows 10 |
As I've said: please say which OS you're using, and ideally share a reproduction |
@mischnic apologies - Windows 10 |
Looking at the offending line:
The error (I think) is that stream is undefined which comes from I would say it's about a 50% success rate of running the build with deleting the dist folder between executions and without any code modification each time. Is there a way to tease out the file path? Parcel 2.6.2, Node 16.3.0, Windows 11 |
@andywilsonuk you could try just sticking in some console.logs in the build, directly modify the file in your node modules |
There's only a handful of places where hashStream is used: https://grep.app/search?q=hashStream&filter[repo][0]=parcel-bundler/parcel When you edit node_modules to add logging, be sure to modify the |
Right, I think it's this commit from last month. When I follow up the stack the error is coming from line 79 in that file. Here's an example of the
It isn't always the same file but they it seems to always error on an un-optimised mp3 file > 20KB. |
If it's line 79, then #8337 hopefully fixes it. |
Its fixed into 2.7.0 or not ? |
I haven't seen any problems building after upgrading to 2.7.0 |
🐛 bug report
After trying to update to parcel 2.6.1 and 2.6.2, when trying to build we get an error of
@parcel/compressor-raw: Cannot read properties of undefined (reading 'on')
. It's an error that happens when packaging different types of files (from .js to .ico to image assets)). Everything works fine on parcel 2.6.0.🎛 Configuration (.babelrc, package.json, cli command)
We're using the following
.parcelrc
:🤔 Expected Behavior
After updating to parcel 2.6.1 or 2.6.2, build completes succesfully.
😯 Current Behavior
After updating to parcel 2.6.1 or 2.6.2, build will most of the time error with message:
Packaging index.[hash].js...
@parcel/compressor-raw: Cannot read properties of undefined (reading 'on')
On few occassions, re-running
build
will complete ok.The text was updated successfully, but these errors were encountered: