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

Typecheck fails with Yarn PnP #4393

Closed
huwshimi opened this issue Oct 30, 2023 · 0 comments · Fixed by #4412
Closed

Typecheck fails with Yarn PnP #4393

huwshimi opened this issue Oct 30, 2023 · 0 comments · Fixed by #4412
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@huwshimi
Copy link

Describe the bug

When running vitest typecheck --run in a project using Yarn PnP there is an unhandled error (--watch does not show this error):

$ yarn run vitest typecheck --run
Testing types with tsc and vue-tsc is an experimental feature.
Breaking changes might not follow semver, please pin Vitest's version when using it.

 RUN  v0.34.6 /home/ubuntu/code/tmp/yarn-pnp-vite-typecheck

 ✓ types.test-d.ts

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

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

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Typecheck Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: error TS5033: Could not write file '/home/ubuntu/code/tmp/yarn-pnp-vite-typecheck/.yarn/__virtual__/vitest-virtual-8a19f9ae5b/4/.yarn/berry/cache/vitest-npm-0.34.6-48e1d6f80a-10c0.zip/node_modules/vitest/dist/tsconfig.tmp.tsbuildinfo': Unimplemented.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 Test Files  1 passed (1)
      Tests  1 passed (1)
Type Errors  no errors
     Errors  1 error
   Start at  11:43:39
   Duration  2.48s

It looks like it could be trying to write the tsbuildinfo file to the yarn cache.

In tsconfig.json if you set "module": "System", and "outFile": "./build" the error goes away. Likewise, setting nodeLinker: node-modules in .yarnrc.yml it also makes the issue go away.

Reproduction

https://github.com/huwshimi/yarn-pnp-vite-typecheck

Run yarn install && yarn run vitest typecheck --run.

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (4) arm64 unknown
    Memory: 11.12 GB / 11.66 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.9.0 - /snap/node/7891/bin/node
    Yarn: 1.22.19 - /snap/node/7891/bin/yarn
    npm: 10.1.0 - /snap/node/7891/bin/npm

Note the yarn version from envinfo is not correct.


$ yarn --version
4.0.1

I'm also able to reproduce this with Yarn 3.6.4.



### Used Package Manager

yarn

### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitest-dev/vitest/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitest.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vitest/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vitest/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@huwshimi huwshimi changed the title typecheck fails with Yarn PnP Typecheck fails with Yarn PnP Oct 30, 2023
@sheremet-va sheremet-va added bug p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Oct 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants