qmhc / vite-plugin-dts

A Vite plugin for generating `.d.ts` files.
MIT License
1.24k stars 84 forks source link

After 2.1.X update i get TS2307: Cannot find module ... error on all my .vue files #384

Open auirarrazaval opened 6 days ago

auirarrazaval commented 6 days ago

Describe the bug

It took me a while to narrow this down from the project, but eventually I came to realize that this library's update is what triggered the errors. I'm guessing that it's related to the vue language server, but no sure what exactly.

In general terms, when updating to v2.1.X a TS2307 error starts showing up for every vue file. I have provided a minimum reproduction, which is basically my project trimmed

Reproduction

https://github.com/auirarrazaval/vite-plugin-dts-build-error-repr

Steps to reproduce

git clone ...
# In case not enabled, to use yarn4
corepack enable
yarn
yarn install
yarn sdks
yarn build

Notice that the build goes through. Also note that the vue-tsc command runs with no issues, but the tsc error shows up when building image

If you downgrade vite-plugin-dts to @4.0.3, the error doesn't show up: image

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 9 5900HS with Radeon Graphics
    Memory: 2.25 GB / 7.76 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.16.0 - /tmp/xfs-47c61424/node
    Yarn: 4.4.1 - /tmp/xfs-47c61424/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm

libraries should be the versions sin the package.json, as I updated it

Validations

qmhc commented 2 days ago

It seems to only be occurred with yarm@4 ...

Should be a bug with pnp mode, because the package resolve method doesn't support pnp.