-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
When linking a npm package to a equivalent local folder, starting dev server with --force is failing #14994
Comments
we had a similar issue with our vite and our own private npm repo. In our case the browser was complaining about a missing default import. The reason we concluded was that we used Removing it solved the issue. It was there on the first place since we had issues with updating the local linking because vite had still a version cached in |
I was able to reproduce, but setting |
For me it was helpful to go to In our case it was the react hooks error with npm link packages (facebook/react#15812). I found the dependency which was taken from our local package's node_modules (probably for some optimization reasons, idk). I added it to Vite config via include in main application dir, and Vite started to take that dependency from main application's node_modules.
|
I am also having this issue with
|
Closing due to lack of response from the issue author. |
Had the same issue, setting preserveSymlinks: true solved the issue for me! Thanks @gabrieladeniji |
Describe the bug
I have some privates npm packages that, when installed through pnpm (or npm) works like it should in my vite project.
However when I link this package with a symlink to where it is in my computer, then starting the dev server fails. (when runing vite --force)
I tried to copy paste the exact content of the published package into the linked one (to check if other files where influencing vite) and the issue persist. I was previously doing it with a webpack build system and it worked well.
This is my vite config
I tried to play with optimizeDeps and resolve, without success
When I run the project after linking the first error I get is
That why I tried the resolve alias, but then when I go the resolve alias for lodahs I get
The requested module [...] does not provide an export named 'capitalize' (...)
Reproduction
https://stackblitz.com/edit/vitejs-vite-m2xfhp?file=vite.config.js
Steps to reproduce
node_modules/@makeit-studio/helpers
somewhere else in your computer3.1.
npm link
where you copied the folder.3.2.
npm link @makeit-studio/helpers
in the download reproduction linknpx vite --force
(force is important if you ran the project before doing the link)You should get the error of my screenshot:
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: