Closed eyeball-bot closed 1 year ago
Here's a workaround that did the job for me:
# .yarnrc.yml
packageExtensions:
vite-tsconfig-paths@*:
peerDependencies:
vite: "*"
I think this could be adapted into a general fix, just needs a better version number for the peer dep (not *
)
I see that Vite was excluded from peer dependencies in this issue https://github.com/aleclarson/vite-tsconfig-paths/issues/89
But also I see an explicit import from Vite https://github.com/aleclarson/vite-tsconfig-paths/blob/master/src/index.ts#L8
Because of this, in pnp mode, the plugin stops working
We are making a library for creating a boilerplate (similar to create-react-app), which includes this plugin. And we just can't force all our users to do the workaround as @arempe93 pointed out
It seems the most logical solution would be to make Vite peer a dependency, but an optional one:
"peerDependencies": {
"vite": "^4.0.0"
},
"peerDependenciesMeta": {
"vite": {
"optional": true
}
}
@DiFuks PR is very welcome, thanks
Fixed in v4.0.6
Thanks @DiFuks
I still get this error. 😕
Error: vite-tsconfig-paths tried to access vite (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
Required package: vite (via "vite/package.json")
Required by: vite-tsconfig-paths@virtual:8fe8e73e4af70ba096693cc74c354e4c9005b052d376fa7b6797025ae28760335def907c17d9995f6836709b832f51b25de90a4f09ea95ae730e10e9bf3077c0#npm:4.2.0 (via /mnt/c/Users/kriese/projects/gh/containerbase/base/.yarn/__virtual__/vite-tsconfig-paths-virtual-9fcbf3395b/0/cache/vite-tsconfig-paths-npm-4.2.0-af5eeb1a7e-73a8467de7.zip/node_modules/vite-tsconfig-paths/dist/index.mjs)
Ancestor breaking the chain: containerbase@workspace:.
Hi,
is it possible to use this plugin with yarn pnp? currently i'm getting the following error when starting vite:
any idea how to solve this?
thanks