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

Module externalized for browser compatibility warning when update to Vite ^5.0.11 #96

Open
cn-2k opened this issue Jan 8, 2024 · 2 comments

Comments

@cn-2k
Copy link

cn-2k commented Jan 8, 2024

Im building an Vue.js App and after update my vite version I start to receive this warning on console:

image

When going to vite Troubleshooting section they say:

When you use a Node.js module in the browser, Vite will output the following warning.

Module "fs" has been externalized for browser compatibility. Cannot access "fs.readFile" in client code.

This is because Vite does not automatically polyfill Node.js modules.

We recommend avoiding Node.js modules for browser code to reduce the bundle size, although you can add polyfills manually. If the module is imported from a third-party library (that's meant to be used in the browser), it's advised to report the issue to the respective library.

Any tip of how to avoid this warning? Thanks.

[EDIT] I've seen a similar issue opened on SheetJS a time ago: SheetJS/sheetjs#2765

@mariia-yushmanova
Copy link

I encountered the same situation and did not find a solution

@DaanDL
Copy link

DaanDL commented Mar 5, 2024

Looking at the code, I suspect that it's not this repo where the issue is but a dependency: "@e965/xlsx"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants