Skip to content
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

build time went from 40s to 10min #1790

Closed
coffeeowl opened this issue Jul 25, 2018 · 6 comments
Closed

build time went from 40s to 10min #1790

coffeeowl opened this issue Jul 25, 2018 · 6 comments

Comments

@coffeeowl
Copy link

coffeeowl commented Jul 25, 2018

🐛 bug report

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

🌍 Your Environment

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

@coffeeowl coffeeowl changed the title after 1.9.7 update build time went from 40s to 10min build time went from 40s to 10min Jul 25, 2018
@coffeeowl
Copy link
Author

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 :-)

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Jul 28, 2018

Does it still happen on latest version, as the watcher has been slightly improved?

@coffeeowl
Copy link
Author

Yes, the error I posted is for 1.9.7

@kai-leddy
Copy link

kai-leddy commented Aug 2, 2018

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.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Aug 2, 2018

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)

@DeMoorJasper
Copy link
Member

Closing this as it appears to be a project issue, not a parcel issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants