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

1.5.1 Throws Unhandled Rejections TypeErrors in coverage-instanbul - 1.4.0 works fine #5615

Closed
6 tasks done
httpete opened this issue Apr 24, 2024 · 5 comments
Closed
6 tasks done
Labels
feat: browser Issues and PRs related to the browser runner feat: coverage Issues and PRs related to the coverage feature needs reproduction pending triage

Comments

@httpete
Copy link

httpete commented Apr 24, 2024

Describe the bug

I have a large suite of tests (1200) and it is totally fine with 1.4.0. As soon as I upgrade

"@vitest/browser": "1.5.1",
"@vitest/coverage-istanbul": "1.5.1",
"@vitest/ui": "1.5.1",

I get:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Vitest caught 3 unhandled errors during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: Failed to fetch dynamically imported module: http://localhost:5173/@id/@vitest/coverage-istanbul

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: Failed to fetch dynamically imported module: http://localhost:5173/@id/@vitest/coverage-istanbul

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: Failed to fetch dynamically imported module: http://localhost:5173/@id/@vitest/coverage-istanbul
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

### Reproduction

.

### System Info

```shell
System:
    OS: Linux 5.14 Rocky Linux 9.3 (Blue Onyx)
    CPU: (8) x64 AMD EPYC 7B13
    Memory: 14.14 GB / 31.09 GB
    Container: Yes
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 20.12.1 - ~/.asdf/installs/nodejs/20.12.1/bin/node
    npm: 10.5.0 - ~/.asdf/plugins/nodejs/shims/npm
  npmPackages:
    @vitejs/plugin-react: 4.2.1 => 4.2.1 
    @vitest/browser: 1.5.1 => 1.5.1 
    @vitest/coverage-istanbul: 1.5.1 => 1.5.1 
    @vitest/ui: 1.5.1 => 1.5.1 
    vite: 5.2.10 => 5.2.10 
    vitest: 1.5.1 => 1.5.1

Used Package Manager

npm

Validations

@httpete httpete changed the title 1.5.1 Throws Unhandled Errors in coverage-instanbul - 1.4.0 works fine 1.5.1 Throws Unhandled Rejections TypeErrors in coverage-instanbul - 1.4.0 works fine Apr 24, 2024
@hi-ogawa
Copy link
Contributor

Can you check if v1.5.0 works? Also just in case, can you test without coverage on v1.5.1?

@httpete
Copy link
Author

httpete commented Apr 25, 2024

1.5.0 started failing on all my snapshots.
1.5.2 (just released 4/25) works on all snapshots - But dies with 1 error (exact same suite of tests)

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: Failed to fetch dynamically imported module: http://localhost:5173/@id/@vitest/coverage-istanbul
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

@httpete
Copy link
Author

httpete commented Apr 25, 2024

Coverage enabled false stops the error completely.

@hi-ogawa hi-ogawa added feat: coverage Issues and PRs related to the coverage feature feat: browser Issues and PRs related to the browser runner labels Apr 25, 2024
@AriPerkkio
Copy link
Member

I'm unable to reproduce this. It works fine here: AriPerkkio/aria-live-capture#191.

Without reproduction setup there is nothing we could do. I would recommend to check your package manager's lockfile. Make sure all Vitest packages have the same version.

$ pnpm test

> aria-live-capture@1.0.2 test /x/aria-live-capture
> vitest run

 RUN  v1.5.2 /x/aria-live-capture
      [Browser] Browser runner started at http://localhost:5173/
      Coverage enabled with istanbul

 ✓ |Browser| test/capture-announcements.test.ts (109)
 ✓ |Browser| test/utils.test.ts (56)

 Test Files  2 passed (2)
      Tests  164 passed | 1 todo (165)
   Start at  17:26:55
   Duration  613ms (transform 0ms, setup 10ms, collect 144ms, tests 23ms, environment 0ms, prepare 0ms)

 % Coverage report from istanbul
--------------------------|---------|----------|---------|---------|--------------------------------
File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s              
--------------------------|---------|----------|---------|---------|--------------------------------
All files                 |   90.25 |     85.5 |   97.87 |    93.3 |                                
 capture-announcements.ts |   83.67 |     75.3 |   93.33 |   89.28 | 69,117,151-152,161-168,177,207 
 config.ts                |     100 |      100 |     100 |     100 |                                
 dom-node-safe-guards.ts  |     100 |      100 |     100 |     100 |                                
 interceptors.ts          |   88.46 |    76.92 |     100 |   88.46 | 18,56,64                       
 queries.ts               |   95.23 |    94.44 |     100 |   97.36 | 38                             
 utils.ts                 |   96.87 |    93.75 |     100 |   98.18 | 127                            
--------------------------|---------|----------|---------|---------|--------------------------------

Copy link

Hello @httpete. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: browser Issues and PRs related to the browser runner feat: coverage Issues and PRs related to the coverage feature needs reproduction pending triage
Projects
None yet
Development

No branches or pull requests

3 participants