Hi,
I start getting the following error while using netlify function:
Feb 12, 04:30:23 PM: c57193e6 2023-02-12T15:30:24.660Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '@octokit/core'\nRequire stack:\n- /var/task/functions/colab.js\n- /var/task/colab.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '@octokit/core'","Require stack:","- /var/task/functions/colab.js","- /var/task/colab.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:1000:17)"," at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1035:21)"," at async start (file:///var/runtime/index.mjs:1200:23)"," at async file:///var/runtime/index.mjs:1206:1"]}
Feb 12, 04:30:23 PM: c57193e6 2023-02-12T15:30:24.916Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '@octokit/core'\nRequire stack:\n- /var/task/functions/colab.js\n- /var/task/colab.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '@octokit/core'","Require stack:","- /var/task/functions/colab.js","- /var/task/colab.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:1000:17)"," at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1035:21)"," at async start (file:///var/runtime/index.mjs:1200:23)"," at async file:///var/runtime/index.mjs:1206:1"]}
Feb 12, 04:30:23 PM: c57193e6 Unknown application error occurred
Feb 12, 04:30:23 PM: c57193e6 Runtime.ImportModuleError
Feb 12, 04:30:24 PM: c57193e6 Duration: 222.19 ms Memory Usage: 15 MB
However if tested locally with netlify dev
, the error does not happen and everything is working as expected.
More info how things are coded and configured:
- netlify.toml
- functions/colab.js
Code:
Deployment:
Any hints please
Thanks !