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

Cannot find modules (third-party libraries) with Yarn 3 #103

Open
mohannad-s-awad opened this issue Aug 20, 2022 · 5 comments
Open

Cannot find modules (third-party libraries) with Yarn 3 #103

mohannad-s-awad opened this issue Aug 20, 2022 · 5 comments
Labels
help wanted Extra attention is needed need more info Further information is requested

Comments

@mohannad-s-awad
Copy link

Greetings and thank you for this useful plugin.

I tried to you use your plugin with a Yarn 3 setup but it seems to struggle finding modules as there is no node_modules folder with Yarn 3. Any clue?

@brendanhealey
Copy link

I'm also experiencing this problem, everything was fine until I switched yarn 3 to use Plug'n'Play thereby eliminating node_modules...

image

@aruntj
Copy link

aruntj commented Mar 12, 2023

I face the exact same issue with Yarn3 PnP. Is there another way to get this working without opting out of Yarn PnP

@magnattic
Copy link

Did anyone find a workaround yet? This basically makes it unusable for our library since most generated types resolve to any.

@psychobolt
Copy link

psychobolt commented Apr 24, 2023

No workaround for this plugin, but you can chain a npm script that runs tsc after vite e.g.

  "dev": "yarn build-src -w & yarn build-dts --watch",
  "build": "yarn build-src && yarn build-dts",
  "build-src": "vite build",
  "build-dts": "tsc --project tsconfig.dts.json"

./tsconfig.dts.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "declaration": true,
    "noEmit": false,
    "emitDeclarationOnly": true,
    "outDir": "dist"
  }
  "include": ["src"]
}

@magnattic
Copy link

Awesome, that works for me, thanks!

Would be nice if the plugin could be updated to do the same.

@qmhc qmhc added help wanted Extra attention is needed need more info Further information is requested labels Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants