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

when uniqid in vite project and typescript show error Uncaught Error: Module "os" has been externalized for browser compatibility. Cannot access "os.networkInterfaces" in client code. #45

Open
gradyll opened this issue Jul 16, 2022 · 2 comments

Comments

@gradyll
Copy link

gradyll commented Jul 16, 2022

when i import uniqid,it show this error:"Uncaught Error: Module "os" has been externalized for browser compatibility. Cannot access "os.networkInterfaces" in client code."

Why?

@mryechkin
Copy link

I just ran into this issue as well, and looks like that's because this package only exports CommonJS module format, and Vite doesn't polyfill those by default:

Screen Shot 2022-07-18 at 11 16 32 AM

I'm going to be looking for an ESM-compatible alternative personally.

@Jonas096
Copy link

We are facing this issue as well

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