The original report was for 1.9.7, but downgrading to 1.9.2 didn't solve the issue. We added a bunch of new code and now any version gets stuck for 10 minutes before build succeeds. Builds on heroku take 15 minutes.
rebuilds with .cache apparently don't work at all (at least on 1.9.7)
⠸ Building ZoomOutTwoTone.js...(node:12234) UnhandledPromiseRejectionWarning: TypeError: this.child.send is not a function
at Worker.send (<topsecret>/node_modules/parcel-bundler/src/workerfarm/Worker.js:91:29)
at Worker.call (<topsecret>/node_modules/parcel-bundler/src/workerfarm/Worker.js:120:10)
at Promise (<topsecret>/node_modules/parcel-bundler/src/workerfarm/Worker.js:56:12)
at new Promise (<anonymous>)
at Worker.fork (<topsecret>/node_modules/parcel-bundler/src/workerfarm/Worker.js:55:11)
at WorkerFarm.startChild <topsecret>/node_modules/parcel-bundler/src/workerfarm/WorkerFarm.js:89:12)
at WorkerFarm.processQueue (<topsecret>/node_modules/parcel-bundler/src/workerfarm/WorkerFarm.js:128:12)
at Promise (<topsecret>/node_modules/parcel-bundler/src/workerfarm/WorkerFarm.js:196:12)
at new Promise (<anonymous>)
at WorkerFarm.addCall (<topsecret>/node_modules/parcel-bundler/src/workerfarm/WorkerFarm.js:188:12)
(node:12234) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:12234) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
🚨 <topsecret>/node_modules/@material-ui/icons/SettingsPower.js: EMFILE: too many open files, open '<topsecret>/node_modules/@material-ui/icons/SettingsPower.js'
Error: EMFILE: too many open files, open '<topsecret>/node_modules/@material-ui/icons/SettingsPower.js'
Not sure if this is somehow connected to inotfy, but just in case my limit is fs.inotify.max_user_watches = 128000
that didn't resolve the issue
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.7
| Node | 10.5.0
| npm/Yarn | 6.1.0
| Operating System | Linux 4.16.13-1-ARCH #1 SMP PREEMPT
the version before update was 1.9.2
One of my colleagues has pointed out that the issue is likely connected to our update of material-ui/icons from v1 to v2.
After downgrading icons to 1.1.0 build time went back to 40s. Not sure who to blame :-)
Does it still happen on latest version, as the watcher has been slightly improved?
Yes, the error I posted is for 1.9.7
This also happens for me using @material-ui/icons if I import named exports, as this causes all of the icons to be included in the bundle and there is a lot of them.
Until tree shaking support in parcel is stable and supported for the development server, the workaround is to import all material-ui icons with full paths in your application such as:
import ArrowForward from "@material-ui/icons/ArrowForward"
This is also detailed in the @material-ui/icons readme as the recommended way to import icons if your environment does not support tree shaking.
Parcel supports treeshaking, it's just not advised to use it in production.
Tree shaking is something that mostly happens after parsing though, so this would probably not have the expected/wanted effect on build time and it's also a very bad practise to rely on treeshaking this heavily as it's no magic. (def not if you can include the icons one at a time)
Closing this as it appears to be a project issue, not a parcel issue
Most helpful comment
This also happens for me using @material-ui/icons if I import named exports, as this causes all of the icons to be included in the bundle and there is a lot of them.
Until tree shaking support in parcel is stable and supported for the development server, the workaround is to import all material-ui icons with full paths in your application such as:
import ArrowForward from "@material-ui/icons/ArrowForward"This is also detailed in the @material-ui/icons readme as the recommended way to import icons if your environment does not support tree shaking.