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

[Bug?]: vite.config.ts 'test' entry typing are not working with Yarn PnP #6293

Open
1 task
unrealsolver opened this issue May 13, 2024 · 0 comments
Open
1 task
Labels
bug Something isn't working

Comments

@unrealsolver
Copy link
Contributor

unrealsolver commented May 13, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

TS stops recognizing vite.config.ts test entry once PnP is enabled.
https://github.com/unrealsolver/yarn-pnp-vitest-types/blob/main/apps/nxtest/vite.config.ts#L35
The only difference here is npm vs yarn pnp. No other lines of code has changed.

To reproduce

(NOTE this link is broken https://yarnpkg.com/advanced/sherlock)

  1. To observe: just check out this repo and open the vite.config.ts in editor, that supports LSP.

To replicate from scratch (optional):

  1. Create sampe TS project that uses vite (by using @nx/react, for example)
  2. corepack enable
  3. corepack prepare yarn@4 --activate
  4. yarn set version 4
  5. yarn dlx @yarnpkg/sdks vim
  6. yarn
  7. open an editor and go to vite.config.ts

Environment

System:
  OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Binaries:
  Node: 18.16.0 - /tmp/xfs-a293c1f8/node
  Yarn: 4.2.2 - /tmp/xfs-a293c1f8/yarn
  npm: 9.5.1 - ~/.local/share/nvm/v18.16.0/bin/npm

Additional context

Error:

apps/nxtest/vite.config.ts:35:3 - error TS2769: No overload matches this call.
  The last overload gave the following error.
    Object literal may only specify known properties, and 'test' does not exist in type 'UserConfigExport'
@unrealsolver unrealsolver added the bug Something isn't working label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant