Hello,
I am stuck on a problem that I can’t get my head around.
I have netlify function identity-login.js where I do:
const faunadb = require('faunadb');
And when trying to login it fails in the log with Cannot find module ‘faunadb’ (full log at the bottom).
But, it does work in other functions like registration (identity-signup.js), no complaints at all.
Is there a problem in identity-login.js that it can’t be used there or what am I missing?
Thank you!
Full log
Feb 7, 07:25:07 PM: INIT_START Runtime Version: nodejs:16.v28 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:3a370867e1aa01a0dd678120fe6e1db0dea78161534d467823c8e0c4b84246ecFeb 7, 07:25:07 PM: 2024-02-07T18:25:07.503Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'faunadb'\nRequire stack:\n- /var/task/functions/identity-login.js\n- /var/task/identity-login.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module 'faunadb'","Require stack:","- /var/task/functions/identity-login.js","- /var/task/identity-login.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:1087:17)"," at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)"," at async start (file:///var/runtime/index.mjs:1282:23)"," at async file:///var/runtime/index.mjs:1288:1"]}Feb 7, 07:25:07 PM: INIT_REPORT Init Duration: 163.14 ms Phase: init Status: error Error Type: Runtime.ExitErrorFeb 7, 07:25:07 PM: 2024-02-07T18:25:07.687Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'faunadb'\nRequire stack:\n- /var/task/functions/identity-login.js\n- /var/task/identity-login.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module 'faunadb'","Require stack:","- /var/task/functions/identity-login.js","- /var/task/identity-login.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:1087:17)"," at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)"," at async start (file:///var/runtime/index.mjs:1282:23)"," at async file:///var/runtime/index.mjs:1288:1"]}Feb 7, 07:25:07 PM: INIT_REPORT Init Duration: 189.68 ms Phase: invoke Status: error Error Type: Runtime.ExitErrorFeb 7, 07:25:07 PM: Unknown application error occurred Runtime.ImportModuleError