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

Error No known conditions for "." specifier with vitest 3.0.1 #7277

Open
6 tasks done
silverwind opened this issue Jan 17, 2025 · 1 comment
Open
6 tasks done

Error No known conditions for "." specifier with vitest 3.0.1 #7277

silverwind opened this issue Jan 17, 2025 · 1 comment

Comments

@silverwind
Copy link
Contributor

silverwind commented Jan 17, 2025

Describe the bug

Since vitest 3, I'm running into a new resolve error relateded to the @neodrag/react npm module. The exact same code worked with vitest 2.

Vite is able to resolve and build this module fine (npx vite build works), it fails only with vitest. Let me know if you suspect a bug in the module, its source is here.

 FAIL  index.test.js [ index.test.js ]
Error: Failed to resolve entry for package "@neodrag/react". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@neodrag/react" package
  Plugin: vite:import-analysis
  File: /Users/silverwind/git/vitest-resolve-bug/index.test.js:1:31
  1  |  import { useDraggable } from "@neodrag/react";

Reproduction

https://github.com/silverwind/vitest-resolve-bug

git clone https://github.com/silverwind/vitest-resolve-bug
cd vitest-resolve-bug
npm install
npx vitest

System Info

System:
    OS: macOS 15.2
    CPU: (16) arm64 Apple M3 Max
    Memory: 9.96 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.6.0 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.9.2 - /opt/homebrew/bin/npm
    pnpm: 9.15.4 - ~/.npm-global/bin/pnpm
    bun: 1.1.43 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 132.0.6834.84
    Firefox Nightly: 129.0a1
    Safari: 18.2
  npmPackages:
    vitest: 3.0.1 => 3.0.1

Used Package Manager

npm

Validations

@silverwind silverwind changed the title Error Failed to resolve entry for package since vitest 3 Error No known conditions for "." specifier since vitest 3 Jan 17, 2025
@silverwind
Copy link
Contributor Author

silverwind commented Jan 17, 2025

@silverwind silverwind changed the title Error No known conditions for "." specifier since vitest 3 Error No known conditions for "." specifier with vitest 3.0.1 Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant