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

🐛 parcel watch in 1.5.0 stuck on "Building someFile.js..." #637

Closed
embiem opened this issue Jan 24, 2018 · 18 comments
Closed

🐛 parcel watch in 1.5.0 stuck on "Building someFile.js..." #637

embiem opened this issue Jan 24, 2018 · 18 comments

Comments

@embiem
Copy link

embiem commented Jan 24, 2018

I tried updating my project from parcel-bundler 1.4.1 to 1.5.0, but parcel watch doesn't finish. I removed the cache folder manually and started the watch command (see exact CLI command below). It gets stuck at some random file, displaying ∞ Building someFile.js... forever.

The parcel build command works btw.

🎛 Configuration (.babelrc, package.json, cli command)

.babelrc:

{
  "presets": ["env", "es2015", "react"],
  "plugins": [
    "transform-class-properties",
    "transform-object-rest-spread",
    "transform-decorators-legacy",
    "transform-es3-member-expression-literals",
    "transform-es3-property-literals"
  ],
  "env": {
    "production": {
      "plugins": ["transform-remove-debugger", "transform-remove-console"]
    }
  }
}

package.json (without name etc. but all deps & scripts):

{
  "dependencies": {
    "animate.css": "^3.5.2",
    "babel-polyfill": "^6.26.0",
    "flag-icon-css": "^2.8.0",
    "immer": "^0.3.0",
    "lodash": "^4.17.4",
    "material-ui": "^1.0.0-beta.12",
    "material-ui-icons": "^1.0.0-beta.10",
    "object.values": "^1.0.4",
    "pubsub-js": "^1.5.7",
    "rc-collapse": "^1.7.6",
    "react": "16.2.0",
    "react-dom": "16.2.0",
    "react-json-view": "^1.13.0",
    "react-onclickoutside": "^6.4.0",
    "react-redux": "5.0.6",
    "react-treebeard": "^2.0.3",
    "redux": "3.7.2",
    "redux-saga": "^0.15.6",
    "redux-thunk": "^2.2.0",
    "reselect": "^3.0.1",
    "workerize": "^0.1.2"
  },
  "devDependencies": {
    "babel-eslint": "7.2.3",
    "babel-jest": "^22.0.3",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
    "babel-plugin-transform-es3-property-literals": "^6.22.0",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-plugin-transform-remove-console": "^6.8.5",
    "babel-plugin-transform-remove-debugger": "^6.8.5",
    "babel-preset-env": "^1.6.1",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "cross-env": "^5.0.2",
    "enzyme": "^2.8.2",
    "eslint": "4.1.1",
    "eslint-config-react-app": "^2.0.1",
    "eslint-plugin-flowtype": "2.34.1",
    "eslint-plugin-import": "2.6.0",
    "eslint-plugin-jsx-a11y": "5.1.1",
    "eslint-plugin-react": "^7.5.1",
    "husky": "^0.14.3",
    "identity-obj-proxy": "^3.0.0",
    "jest": "22.1.2",
    "jest-css-modules": "^1.1.0",
    "lint-staged": "^6.0.0",
    "node-sass": "^4.5.3",
    "parcel-bundler": "1.5.0",
    "prettier": "1.10.2",
    "react-test-renderer": "^16.2.0",
    "redux-mock-store": "^1.2.3",
    "sinon": "^4.1.6"
  },
  "scripts": {
    "watch": "cross-env REACT_APP_VERSION=$npm_package_version parcel watch src/index.js --out-dir ./public/static --public-url ./static/",
    "test": "jest",
    "lint": "eslint ./src",
    "pretty": "prettier --write \"src/**/*.{js,css,md,scss}\"",
    "precommit": "lint-staged",
    "prepush": "npm run test --coverage"
  },
  "lint-staged": {
    "src/**/*.{js,css,md,scss}": [
      "prettier --write",
      "git add"
    ],
    "src/**/*.js": "eslint --max-warnings=0"
  },
  "jest": {
    "rootDir": "src",
    "moduleNameMapper": {
      "\\.(css|less|scss)$": "identity-obj-proxy"
    },
    "transform": {
      "^.+\\.js$": "babel-jest",
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/fileTransformer.js"
    },
    "setupFiles": [
      "<rootDir>/setupTests.js"
    ]
  }
}

Used cli command: yarn watch (see script in package.json above)

🤔 Expected Behavior

I expect the parcel watch command to finish building.

😯 Current Behavior

The command is getting stuck while building.

💁 Possible Solution

No idea, sorry.

🔦 Context

I will have to stay at version 1.4.1 until the watch command works again in my project, as I heavily depend on the watch command during development.

🌍 Your Environment

Software Version(s)
Parcel 1.5.0
Node 8.9.3
npm 5.6.0
yarn 1.3.2
Operating System Microsoft Windows 10 Enterprise [Version 10.0.15063]
@DeMoorJasper
Copy link
Member

Is there anyway you could provide us with the project where this accured or a project where we could reproduce this?

@embiem
Copy link
Author

embiem commented Jan 24, 2018

I sadly can't share the project I'm experiencing the issue in, but I stripped a copy down to re-create the build config and structure and the issue is reproducible in that stripped down project.

@DeMoorJasper You can find the repo here: https://github.com/mBeierl/parcel-watch-issue

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Jan 24, 2018

I tried your repository and found out, that if we change the workerfarmOptions to this, it works:

let opts = {
  maxConcurrentWorkers: getNumWorkers(),
  maxCallTime: 1000,
  maxConcurrentCallsPerWorker: 2
};

this let's a call to the remote worker time out after 1second, and retries Infinite times after a timeout and apparently it doesn't throw a workerTimeout error or any other error, so something inside the code or worker-farm code is freezing the individual workers.

After a bit more research it's always stuck on the same assets (mainly polyfills, so this bug has nothing to do with overworked workers or anything similar, it's an issue within some asset processing or it's just taking extremely long)

@embiem
Copy link
Author

embiem commented Jan 25, 2018

Hmm interesting. I will try to set-up a local development of parcel and debug a little myself. I haven't looked into parcel's source before, so it might take while.

@niicojs
Copy link
Contributor

niicojs commented Jan 29, 2018

I'm having the same issue at each update.
I usually get into this to solve it:

  • update parcel
  • remove .cache
  • remove build folder
  • re-update parcel

and it ends up working...
I never looked closer as I'm doing other stuff when it fails :)

@mikkiek
Copy link

mikkiek commented Feb 1, 2018

I'm having the same issue with niicojs on Windows. his solution with update parcel helps me sometimes...

PS.
1.4.1 build project fast and without issues
1.5.0+ all the time stuck and seems nothing helps already.
PSS.
1.6.1 works stable, no stucks yet.

@Nantris
Copy link

Nantris commented Feb 19, 2018

Alas, I have to do this all every startup of Parcel or it fails to finish building about 75% of the time.

@jkrehm
Copy link
Contributor

jkrehm commented Mar 8, 2018

I'm running into this same issue on my Windows 10 machine. @DeMoorJasper's change to the work options has made it work consistently for me. Specifically the maxCallTime setting (I removed maxConcurrentCallsPerWorker and it's still working).

Like others, mine seems to get bogged down in the babel-polyfills.

@embiem
Copy link
Author

embiem commented Mar 10, 2018

I can confirm that adding maxCallTime = 1000 to the options before initiating the local worker inside the WorkerFarm class fixes the issue consistently for me.

My dirty hack was to open node_modules/parcel-bundler/src/WorkerFarm.js and at line 26 add the line options.maxCallTime = 1000;. The resulting init function:

  init(options) {
    options.maxCallTime = 1000;
    this.localWorker.init(options);
    this.initRemoteWorkers(options);
  }

(if you're on a node version smaller than 8.x, you need to change the file inside the /lib folder and not /src)

@amykapernick
Copy link

amykapernick commented Mar 11, 2018

I'm having the same issue, normally deleting cache works but not anymore. Have tried the maxCallTime hack and that didn't work.

It's randomly getting stuck on different files. Sometimes it's a js file, sometimes scss and sometimes one of the svgs or pngs

Software Version(s)
Parcel 1.6.2
Node 9.7.1
npm 5.6.0
Operating System Windows 10 Pro - Version 1709 - OS Build 16299.251
	"dependencies": {
		"node-sass": "^4.7.2",
		"npm": "^5.7.1",
		"react": "^16.2.0",
		"react-dom": "^16.2.0",
		"react-feather": "^1.0.8",
		"react-helmet": "^5.2.0",
		"react-icons": "^2.2.7",
		"react-media": "^1.6.1",
		"react-router-dom": "^4.2.2",
		"react-svg": "^2.2.10"
	},
	"devDependencies": {
		"autoprefixer": "^7.2.5",
		"babel-eslint": "^8.2.1",
		"babel-preset-env": "^1.6.1",
		"babel-preset-react": "^6.24.1",
		"eslint": "^4.17.0",
		"eslint-config-airbnb": "^16.1.0",
		"eslint-plugin-import": "^2.8.0",
		"eslint-plugin-jsx-a11y": "^6.0.3",
		"eslint-plugin-react": "^7.6.1",
		"parcel-bundler": "^1.6.2"
	}

@DeMoorJasper
Copy link
Member

@amykapernick the sometimes scss sometimes js is probably due to the multiple workers it’s highly likely that it’s always the same file

Sent with GitHawk

@amykapernick
Copy link

@DeMoorJasper the files are always different (footer, header etc) so it's likely to be app.js or index.js then.

Any suggestions on resolving this? It's not actually giving an error, just getting stuck and freezing my terminal

I just got a new computer and I need to get this working because I have a bunch of updates to do. I've tried clearing and updating things multiple times but no success

@jeanfortheweb
Copy link

jeanfortheweb commented Mar 11, 2018

Actually fixed in #901. #900 is the issue. Already fixed a while ago, but not yet merged. Probably just upvote the PR then it should get into the next patch I guess :)

@amykapernick Yes, it's always random, but it's not call time related but call count.

@pke
Copy link
Contributor

pke commented Mar 26, 2018

This bug is still in 1.6.2 and it happens on random files not always the same. Clearing the cache does not help.

@hugufc
Copy link

hugufc commented Mar 29, 2018

Still in 1.7.0.

@damey2011
Copy link

Still in 1.7.0.. It's frustrating

@demeralde
Copy link

Yep, still have it in 1.8.1. I'm on Ubuntu 18.04, not Windows

@DeMoorJasper
Copy link
Member

This is probably a different issue @dspacejs see #1331

@parcel-bundler parcel-bundler locked as resolved and limited conversation to collaborators May 12, 2018
piscisaureus added a commit to libuv/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the amount of data
written exceeds the size of the pipe buffer.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to piscisaureus/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: libuv#1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to piscisaureus/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: libuv#1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 24, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 25, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 25, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 25, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
piscisaureus added a commit to libuv/libuv that referenced this issue May 25, 2018
This fixes a bug where IPC pipe communication would deadlock when both
ends of the pipe are written to simultaneously, and the kernel pipe
buffer has already been filled up by earlier writes.

The root cause of the deadlock is that, while writes to an IPC pipe are
generally asynchronous, the IPC frame header is written synchronously.
So when both ends of the pipe are sending a frame header at the same
time, neither will read data off the pipe, causing both header writes
to block indefinitely.

Additionally, this patch somewhat reduces the spaghetti level in
win/pipe.c.

Fixes: #1099
Fixes: nodejs/node#7657
Fixes: electron/electron#10107
Fixes: parcel-bundler/parcel#637
Fixes: parcel-bundler/parcel#900
Fixes: parcel-bundler/parcel#1137
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests