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

Vitest 0.19 fails to run because of extended, unresolved dependencies #1709

Closed
6 tasks done
benbender opened this issue Jul 25, 2022 · 2 comments · Fixed by #1712
Closed
6 tasks done

Vitest 0.19 fails to run because of extended, unresolved dependencies #1709

benbender opened this issue Jul 25, 2022 · 2 comments · Fixed by #1712

Comments

@benbender
Copy link

benbender commented Jul 25, 2022

Describe the bug

If I update vitest from 0.18, which works fine, to 0.19 using happy-dom, it fails because of missing jsdom. Installed via pnpm. PNPM tries to resolve undeclared dependencies to jsdom, happy-dom & @edge-runtime/vm in vitest 0.19 which, in turn, fails if any of those three deps are not explicitly installed by the user.

I think this may be caused by #1667

> vitest


 DEV  v0.19.0 /Users/bb/Work/happy-dom-repro-544


Test Files  no tests
     Tests  no tests
      Time  202ms (in thread 0ms, Infinity%)

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

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

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: Errors occurred while running tests. For more information, see serialized error.
 ❯ Object.runTests node_modules/.pnpm/vitest@0.19.0_happy-dom@6.0.4/node_modules/vitest/dist/chunk-vite-node-externalize.a2813ad7.mjs:7046:17
 ❯ process.processTicksAndRejections node:internal/process/task_queues:95:5
 ❯ async file:/Users/bb/Work/happy-dom-repro-544/node_modules/.pnpm/vitest@0.19.0_happy-dom@6.0.4/node_modules/vitest/dist/chunk-vite-node-externalize.a2813ad7.mjs:9451:9
 ❯ Vitest.runFiles node_modules/.pnpm/vitest@0.19.0_happy-dom@6.0.4/node_modules/vitest/dist/chunk-vite-node-externalize.a2813ad7.mjs:9465:12
 ❯ Vitest.start node_modules/.pnpm/vitest@0.19.0_happy-dom@6.0.4/node_modules/vitest/dist/chunk-vite-node-externalize.a2813ad7.mjs:9384:5
 ❯ startVitest node_modules/.pnpm/vitest@0.19.0_happy-dom@6.0.4/node_modules/vitest/dist/chunk-vite-node-externalize.a2813ad7.mjs:10134:5
 ❯ CAC.start node_modules/.pnpm/vitest@0.19.0_happy-dom@6.0.4/node_modules/vitest/dist/cli.mjs:664:9

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: {
  "errors": [
    [Error: Failed to resolve import "jsdom" from "node_modules/.pnpm/vitest@0.19.0_happy-dom@6.0.4/node_modules/vitest/dist/chunk-defaults.408a0cfe.mjs". Does the file exist?],
  ],
}

Reproduction

Use the following repro (originally for another issue):

https://github.com/benbender/happy-dom-repro-544

update vitest to 0.19 to see the dependency-issue.

System Info

System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1
    Memory: 87.05 MB / 8.00 GB
    Shell: 3.5.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.6.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.13.2 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 103.0.5060.134
    Firefox: 102.0.1
    Safari: 15.5
  npmPackages:
    vite: ^2.8.6 => 2.9.14
    vitest: ^0.19.0 => 0.19.0

Used Package Manager

pnpm

Validations

@sheremet-va
Copy link
Member

sheremet-va commented Jul 25, 2022

You don’t have jsdom in your package json.

@sheremet-va sheremet-va removed the bug label Jul 25, 2022
@benbender
Copy link
Author

@sheremet-va Yeah, because I'm using happy-dom ;) If I install jsdom additionally to happy-dom, the same error appears for @edge-runtime/vm...

@benbender benbender changed the title Vitest 0.19 fails to run because of missing jsdom Vitest 0.19 fails to run because of extended, unresolved dependencies Jul 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants