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

No known conditions for "./node" entry in "vitest" package #797

Closed
6 tasks done
danielroe opened this issue Feb 19, 2022 · 0 comments · Fixed by #799
Closed
6 tasks done

No known conditions for "./node" entry in "vitest" package #797

danielroe opened this issue Feb 19, 2022 · 0 comments · Fixed by #799

Comments

@danielroe
Copy link
Contributor

Describe the bug

When using vitest (without type: module) I get an error when using the sample config file on https://vitest.dev/guide/features.html#coverage:

import { defineConfig } from 'vitest/node'

export default defineConfig({
  test: {
    coverage: {
      reporter: ['text', 'json', 'html']
    }
  }
})

The error I receive is:

(node:95107) UnhandledPromiseRejectionWarning: Error: No known conditions for "./node" entry in "vitest" package
Require stack:
- /my/project/vite.config.cjs
- /my/project/.yarn/__virtual__/vite-virtual-a0fb16a869/0/cache/vite-npm-2.8.4-148753d590-0531ea17d3.zip/node_modules/vite/dist/node/chunks/dep-971d9e33.js
- /my/project/.yarn/__virtual__/vite-virtual-a0fb16a869/0/cache/vite-npm-2.8.4-148753d590-0531ea17d3.zip/node_modules/vite/dist/node/index.js
    at bail (/my/project/.pnp.cjs:20914:8)
    at resolve (/my/project/.pnp.cjs:20971:32)
    at applyNodeExportsResolution (/my/project/.pnp.cjs:21243:28)
    at resolveUnqualifiedExport (/my/project/.pnp.cjs:21756:35)
    at resolveRequest (/my/project/.pnp.cjs:21827:99)
    at Object.resolveRequest (/my/project/.pnp.cjs:21902:26)
    at Function.external_module_.Module._resolveFilename (/my/project/.pnp.cjs:20732:34)
    at Function.external_module_.Module._load (/my/project/.pnp.cjs:20554:48)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-49tr2g

System Info

System:
    OS: macOS 12.1
    CPU: (8) x64 Apple M1
    Memory: 20.43 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.18.3 - ~/.volta/tools/image/node/14.18.3/bin/node
    Yarn: 3.1.1 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
    npm: 8.3.2 - ~/.volta/tools/image/npm/8.3.2/bin/npm
  Browsers:
    Brave Browser: 97.1.34.80
    Edge: 98.0.1108.56
    Firefox Developer Edition: 98.0
    Safari: 15.2

Used Package Manager

yarn

Validations

@sheremet-va sheremet-va linked a pull request Feb 19, 2022 that will close this issue
chaii3 pushed a commit to chaii3/vitest that referenced this issue May 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 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.

1 participant