Skip to content

run-p: Assertion failed: napi_create_external in fsevents #166

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

Closed
raineorshine opened this issue Mar 17, 2025 · 5 comments
Closed

run-p: Assertion failed: napi_create_external in fsevents #166

raineorshine opened this issue Mar 17, 2025 · 5 comments

Comments

@raineorshine
Copy link

raineorshine commented Mar 17, 2025

Serial execution succeeds, but parallel fails.

I apologize for the heavy steps to reproduce. I will create a more minimal repo if I find time, but wanted to log the bug first since this error is not documented anywhere else.

OS: macOS (M3) v15.3.1
Node: v22.0.0 (not able to upgrade unfortunately)
npm: v10.9.1

Steps to Reproduce

  1. git clone --depth=1 https://github.com/cybersemics/em
  2. cd em
  3. git fetch --depth 1 origin 3d0d5de4853
  4. git checkout 3d0d5de4853
  5. yarn
  6. run-s "lint:*"
  7. run-p "lint:*"

Current Behavior

run-s succeeds.

run-p fails:

Assertion failed: (napi_create_external(env, fseenv, fse_environment_destroy, NULL, &result) == napi_ok), function fse_environment_create, file fsevents.c, line 87. ERROR: "lint:src" exited with 134.

Expected Behavior

Parallel execution should succeed.

@bcomnes
Copy link
Owner

bcomnes commented Mar 17, 2025

Off the top of my head, I have no idea. Will try to poke around if I find time.

@bcomnes
Copy link
Owner

bcomnes commented Mar 18, 2025

One workaround (maybe) is running eslint then run the rest in parallel. run-s lint-eslint && run-p lint:* lint-eslint would be a renamed lint:src task to get it out of the glob that runs in parallel. Also running in series tends to be preferable since interleaved log output can be much more difficult to decipher, even if it runs a little slower.

Also this might related: nodejs/node#44151

@bcomnes
Copy link
Owner

bcomnes commented Mar 18, 2025

Another idea is, have you fully regenerated your lockfile recently? Sometimes old transitives can cause issues too. From a quick googling/llming it seems like parallel execution of things using fsevents can trigger similar errors. I'm guessing this is less of a problem with npm-run-all2 and more with parallel execution of something in your lint stack, which run-s can trigger.

@raineorshine
Copy link
Author

Thanks for your response and the ideas. After further testing I have even seen yarn lint:src fail on its own, so the problem is definitely not npm-run-all2.

My best guess is that it is related to file handles on the eslint cache. --parallel did exacerbate the problem, but it's clearly not the cause. Thanks!

@raineorshine raineorshine closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2025
@bcomnes
Copy link
Owner

bcomnes commented Mar 18, 2025

Ok, good luck!

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

No branches or pull requests

2 participants