-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
build fails with import statement in 3.1.6 #10365
Comments
This could be related: Since 3.1.5 vite has failed when using standard node packages in This vite.config.ts (snippet...)
Fails with the following when
|
Yeah I filed the bug since I thought it was fix for 3.1.5 but npm run build fails for me. Downgrading to 3.1.4 was my workaround. |
You've accidentally installed a |
No your analysis of the bug is incorrect. The fs import is needed by our business. Note that I had to include a minimal test case for the reproduction since I can't add certs to the reproduction. This code below works in 3.1.4 but fails for anything after that. We use certs for HTTPS for Okta security.
|
I mean the |
No you are incorrect. With Vite it is in needed or the build fails with an error. Just note this code works in 3.1.4 just fine but since 3.1.5 it fails. In other words regression error in Vite. I commented out fs and the below error is thrown. We have a workaround with Vite 3.1.4 so I am good. I will just wait until more bug reports come in.
|
I mean, |
The same problem+1 , but I found it got solved if I just remove fs from package.json and install vite 3.1.5+ version. It works well. |
Yes that is what I did too but it is also why I still see it as a bug. If a developer wishes to use a specific version of fs they should be able to. It never conflicted in versions up to 3.1.4. So now I have lost functionality. I hope they restore it so I can upgrade Vite eventually. |
Describe the bug
npm run build fails to complete with v3.1.6 giving me the error "[plugin externalize-deps] Failed to resolve entry for package "fs". The package may have incorrect main/module/exports specified in its package.json." I resolved the problem by downgrading to Vite 3.1.4.
Reproduction
https://stackblitz.com/edit/vitejs-vite-rssden
System Info
Used Package Manager
npm
Logs
ERROR] [plugin externalize-deps] Failed to resolve entry for package "fs". The package may have incorrect main/module/exports specified in its package.json.
This error came from the "onResolve" callback registered here:
The plugin "externalize-deps" was triggered by this import
Validations
The text was updated successfully, but these errors were encountered: