K
Kinde3w ago
COACH

Netlify functions, Web Crypto API (crypto.subtle), set AWS_LAMBDA_JS_RUNTIME to nodejs20.x

I am not posting this as a support request, but to help anyone else in the future. I was having the following issue... TypeError: Cannot read properties of undefined (reading 'subtle') at Object.<anonymous> (/var/task/node_modules/@kinde-oss/kinde-node-express/dist/index.cjs:63:237212) at Module._compile (node:internal/modules/cjs/loader:1364:14) ... This error occurs because the Kinde SDK is trying to access the Web Crypto API (crypto.subtle), this is only available in nodejs19.x, and Netlify defaults to nodejs18.x. https://docs.netlify.com/functions/optional-configuration/?fn-language=js#node-js-version-for-runtime-2
Optional configuration for functions
Learn about optional configuration settings you can use for more control over how your functions are built, deployed, and executed.
1 Reply
CB_Kinde
CB_Kinde3w ago
Thanks @COACH I can add this to our docs so it is discoverable in search and the AI channel. Thanks for sharing.

Did you find this page helpful?