Skip to content

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

@cn-2k

Description

@cn-2k

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions