Version 1.2: Update on runtime support #515
pilcrowonpaper
announced in
Announcements
Replies: 1 comment 7 replies
-
|
Have you considered using cuid2 instead of web crypto? I think it wouldn't have this problem. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Make sure to use 1.2.1 - there was a broken import statement in 1.2.0
Hello! This is an important update as Lucia now documents runtime support:
Node 19?! Yeah... Lucia doesn't rely on any dependencies (including native Node.js modules), which is great, but it requires the
Cryptoweb API. And... the one runtime version that doesn't expose it as a global object is Node.js 18 and lower. (Why do you have to do this to me)So with this update, you'll now have to polyfill and expose
Crypto(specificallywebcryptofrom Nodecryptomodule - yes it's kinda confusing) as a global variable. This is already handled in SvelteKit and does not require any action on your front. For those not using those frameworks (including Astro and Next.js), you have 3 options:[email protected])1. Use the polyfill provided by Lucia
Import
lucia-auth/polyfill/nodebefore initializing Lucia:This is only available for Node.js v16 or later.
2. Use
--experimental-global-webcryptoflagThis is only available for Node.js v16 or later.
3. Use a third party polyfill
Beta Was this translation helpful? Give feedback.
All reactions