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

The version [email protected] freezes nyc mocha #595

Closed
deleonio opened this issue Dec 14, 2020 · 7 comments
Closed

The version [email protected] freezes nyc mocha #595

deleonio opened this issue Dec 14, 2020 · 7 comments

Comments

@deleonio
Copy link

deleonio commented Dec 14, 2020

Since version 0.8.22 the command nyc moche freeze. Version 0.8.21 works.

image

To reproduce this as shell script:

rm -rf demo
mkdir demo
cd demo
npm i -g @leanup/cli@next @leanup/cli-lit-element@next -f
lean create
npm i [email protected] --no-save
npm list --depth=2 | grep esbuild
lean coverage
npm i [email protected] --no-save
npm list --depth=2 | grep esbuild
lean coverage
@evanw
Copy link
Owner

evanw commented Dec 14, 2020

Really sorry about the breakage. I'd like to get this fixed ASAP. However, I can't reproduce this. The lean create command isn't working for me:

 ☀ @leanup/cli-lit-element (v1.1.0-rc.219) execute the following pure command ...
    > npx npm install --loglevel=error --prefer-offline --no-audit --progress=false
 
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @leanup/[email protected]
npm ERR! node_modules/@leanup/cli
npm ERR!   dev @leanup/cli@"^1.1.0-rc.219" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @leanup/cli@"~1.1.0-webpack.0" from @leanup/[email protected]
npm ERR! node_modules/@leanup/cli-addons
npm ERR!   dev @leanup/cli-addons@"^1.1.0-rc.217" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\User\AppData\Local\npm-cache\eresolve-report.txt for a full report.
 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2020-12-14T21_10_52_846Z-debug.log
npm ERR! code 1
npm ERR! path C:\Users\User\Desktop\demo
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm install --loglevel=error --prefer-offline --no-audit --progress=false
 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2020-12-14T21_10_52_879Z-debug.log
 
 ✘ @leanup/cli command execution ended with error (in 7531 ms)

Here are my versions:

> node --version
v15.3.0

> npm --version
7.0.14

This is on 64-bit Windows 10 in a VM. Let me know if you think there's another way to debug this or if I need a specific version of node and/or npm to be able to run that command.

@skyrpex
Copy link

skyrpex commented Dec 14, 2020

It freezes to me as well when transpiling a very simple TS file with esno. I'm trying to reproduce it but no luck so far. I'll post something again if I find more info about it.

@eigilsagafos
Copy link

Could this be the same issue as I was seeing in #596?

@skyrpex
Copy link

skyrpex commented Dec 14, 2020

This may be helpful.

esbuild freezes to me if used with node -r, for example with node -r esbuild-register file.ts.

It freezes on the startWorkerThreadService.runCallSync method, the line looks like this: let status = Atomics.wait(sharedBufferView, 0, 0);

file.ts is just console.log("test");

I'm using

It doesn't happen with [email protected] nor [email protected].

Thing is... if I invoke esbuild.transformSync from a simple build.js file, it works as expected and the atomic continues. It looks like this:

var esbuild = require("esbuild");

esbuild.transformSync(`console.log("ha");`, {
  sourcefile: `${__dirname}/file.ts`,
  sourcemap: true,
  loader: "ts",
  target: undefined,
  jsxFactory: undefined,
  jsxFragment: undefined,
});

@evanw
Copy link
Owner

evanw commented Dec 14, 2020

Thanks for the tip. I can also reproduce it when using esbuild-register. The worker is created but the parentPort is null, so the worker thread is completely disconnected from the main thread. This might be a bug in node itself. Perhaps the worker_threads module is unusable as a general-purpose parallelism mechanism. I will push a revert of recent change that makes use of the worker_threads library, which should fix this issue.

@evanw
Copy link
Owner

evanw commented Dec 14, 2020

This should now be fixed in version 0.8.23. Again, sorry for the breakage. I now have test coverage for node -r so this shouldn't happen again.

@deleonio
Copy link
Author

Thank you @evanw - and for your advice - sorry.

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

4 participants