Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Cannot import from a type-only package #6788

Closed
6 tasks done
FelixGirard opened this issue Oct 24, 2024 · 0 comments
Closed
6 tasks done

Cannot import from a type-only package #6788

FelixGirard opened this issue Oct 24, 2024 · 0 comments

Comments

@FelixGirard
Copy link

Describe the bug

I have a type-only package. We are importing from it and building successfully.
When vitest encounter that imports, it fails with the error:
Failed to resolve entry for package "@types/packageName". The package may have incorrect main/module/exports specified in its package.json.

Reproduction

Here is a small reproduction using @types/base64-js:

https://stackblitz.com/edit/vitest-dev-vitest-tcivys?file=test%2Fbasic.test.ts

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
    Memory: 10.15 GB / 31.67 GB
  Binaries:
    Node: 18.20.2 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.1 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @vitest/coverage-istanbul: 2.1.2
    vitest: 2.1.2

Used Package Manager

pnpm

Validations

@vitest-dev vitest-dev locked and limited conversation to collaborators Oct 25, 2024
@hi-ogawa hi-ogawa converted this issue into discussion #6791 Oct 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant