You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Svelte Kit, it uses Vite. And I have problems with nanoid, because index.browser.js has checks on crypto being available on global namespace.
Even though the library's functions are not called during SSR, the module still gets imported in the Node. So this is what you would get in the new default Svelte Kit project if you just import nanoid in a component and do nothing with it:
11:17:09 AM [vite] Error when evaluating SSR module /node_modules/nanoid/index.dev.js:
Error: Your browser does not have secure random generator. If you don’t need unpredictable IDs, you can use nanoid/non-secure.
at /node_modules/nanoid/index.dev.js:28:11
at instantiateModule (../node_modules/vite/dist/node/chunks/dep-0776dd57.js:68919:166) (x163)
I propose to move the check inside the functions.
The text was updated successfully, but these errors were encountered:
I use Svelte Kit, it uses Vite. And I have problems with nanoid, because
index.browser.js
has checks oncrypto
being available onglobal
namespace.Even though the library's functions are not called during SSR, the module still gets imported in the Node. So this is what you would get in the new default Svelte Kit project if you just import nanoid in a component and do nothing with it:
I propose to move the check inside the functions.
The text was updated successfully, but these errors were encountered: