parcel: 2.6.1 - 2.6.2: build error @parcel/compressor-raw: Cannot read properties of undefined (reading 'on')

πŸ› 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:

{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.{js,mjs,jsx,cjs,ts,tsx}": [
      "@parcel/transformer-js",
      "@parcel/transformer-react-refresh-wrap"
    ]
  }
}

πŸ€” 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.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 18 (6 by maintainers)

Most upvoted comments

If it’s line 79, then https://github.com/parcel-bundler/parcel/pull/8337 hopefully fixes it.