-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
nyc
+ esm
is broken in latest NodeJS versions
#1530
Comments
I wonder whether it's related to #1528 |
Latest NodeJS versions broke nyc. This PR disables it temporarily. istanbuljs/nyc#1530 An workitem is logged to track re-enabling it after the issue is resolved. Azure#27128
Latest NodeJS versions broke nyc. This PR disables it temporarily. istanbuljs/nyc#1530 An workitem is logged to track re-enabling it after the issue is resolved. #27128
/cc @RafaelGSS who signed off on nodejs/node@15bced0bde. Any insights? |
This change should only have effect when /cc @bmeck |
@RafaelGSS nyc works fine in previous NodeJS build 18.17.0. The error is thrown by the new code added in the commit. |
15bced0bde seems the only related commit in 18.17.1 https://nodejs.org/en/blog/release/v18.17.1#commits
|
This was a security release. I'm travelling at the moment but looks like |
Can you create a reproducible example? I can provide a fix very quickly. |
@RafaelGSS yeah I have it in the issue description https://github.com/jeremymeng/nyc-repro |
@RafaelGSS Any updates? |
Private repository |
Oops sorry. never meant to make it private. Fixed now. |
I looked at that now and it's not a ➜ nyc-repro git:(main) ✗ git remote -v
origin [email protected]:jeremymeng/nyc-repro.git (fetch)
origin [email protected]:jeremymeng/nyc-repro.git (push)
➜ nyc-repro git:(main) ✗ git rev-parse HEAD
48d25f8b353e483833fbf37489dcc4fae14651ef
➜ nyc-repro git:(main) ✗ curl https://gist.githubusercontent.com/RafaelGSS/e08193f1328bdbd18ee4d340b6fb9041/raw/0f00994a06d3204e229797ecb8d565a7215ab4b5/gistfile0.txt | git apply
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1009 100 1009 0 0 5347 0 --:--:-- --:--:-- --:--:-- 5513
➜ nyc-repro git:(main) ✗ node -v
v20.8.1
➜ nyc-repro git:(main) ✗ npm run cc
> [email protected] cc
> rimraf ./node_modules/.cache && nyc mocha test/**/*.spec.js
basic test
✓ add correctly
1 passing (2ms)
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
index.js | 100 | 100 | 100 | 100 |
----------|---------|----------|---------|---------|-------------------
➜ nyc-repro git:(main) ✗ git reset --hard
HEAD is now at 48d25f8 add readme
➜ nyc-repro git:(main) ✗ npm run cc
> [email protected] cc
> rimraf ./node_modules/.cache && nyc mocha -r esm test/**/*.spec.js
Transformation error for /Users/rafaelgss/repos/os/nyc-repro/src/index.js ; return original code
The "mod" argument must be an instance of Module. Received an instance of Module
basic test
✓ add correctly
1 passing (1ms)
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|------------------- |
@RafaelGSS It must have something to do with I added the following command to the repro
|
***NO_CI*** The combination of `nyc` + `esm` is broken in latest versions of NodeJS (istanbuljs/nyc#1530 (comment)). Since `esm` package is not actively maintained and its repo is archived, it's less likely that the issue will be fixed. This PR switches to use another code coverage tool `c8` which is not affected. `c8` also respects `.nycrc` config files so those are not renamed in this PR.
***NO_CI*** The combination of `nyc` + `esm` is broken in latest versions of NodeJS (istanbuljs/nyc#1530 (comment)). Since `esm` package is no longer actively maintained and its repo is archived, it's less likely that the issue will be fixed soon. This change switches to use another code coverage tool `c8` which is not affected. `c8` respects `.nycrc` config files so those are not renamed.
***NO_CI*** The combination of `nyc` + `esm` is broken in latest versions of NodeJS (istanbuljs/nyc#1530 (comment)). Since `esm` package is no longer actively maintained and its repo is archived, it's less likely that the issue will be fixed soon. This change switches to use another code coverage tool `c8` which is not affected. `c8` respects `.nycrc` config files so those are not renamed.
***NO_CI*** The combination of `nyc` + `esm` is broken in latest versions of NodeJS (istanbuljs/nyc#1530 (comment)). Since `esm` package is no longer actively maintained and its repo is archived, it's less likely that the issue will be fixed soon. This change switches to use another code coverage tool `c8` which is not affected. `c8` respects `.nycrc` config files so those are not renamed.
nyc
+ esm
is broken in latest NodeJS versions
I am still facing the issue with node 20. Do you have any updates, please? Or any workarounds? |
@Sandy8i we switched to |
Thank you for the quick response. I am actually struggling a little bit with c8. I am on node 20, the latest esm, and the latest c8. When I run my unit tests, I get the below error. Can you please help me identify the correct workspace to discuss the issue? /webui/interface.js:55 SyntaxError: Invalid or unexpected token Thanks again. |
@Sandy8i that's a known |
nyc is not reporting code coverage results after possibly related nodejs change nodejs/node@15bced0bde
Link to bug demonstration repository
https://github.com/jeremymeng/nyc-repro
install package then run
npm run cc
Expected Behavior
(same as in nodejs 18.17.0)
Observed Behavior
a warning followed by passing test but 0% coverage
Troubleshooting steps
cache: false
in my nyc configI added a
rimraf
command to remve the cache directoryEnvironment Information
The text was updated successfully, but these errors were encountered: