uniqid
uniqid copied to clipboard
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.
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?
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:
I'm going to be looking for an ESM-compatible alternative personally.
We are facing this issue as well