Hello, trying to set up a lambda function @ https://development--techinterviewcoach.netlify.app/
The function is at https://development--techinterviewcoach.netlify.app/.netlify/functions/proxy - it’s an entry point that, if all is good, calls other functions stored in netlify/functions/zaps
The function imports a separate js file I wrote import AirtableClient from "./utils/airtable-client.mjs";
as a single point of entry to Airtable.
Running things locally, everything is well - I am able to invoke localhost:8888/.netlify/functions/proxy, pass the appropriate headers and body and get the expects input/ouputs and actions in the db
yet, when I push to netlify and invoke the function with the same headers and body, I get the following error:
Jan 1, 04:11:03 AM: ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'airtable'\nRequire stack:\n- /var/task/proxy.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module 'airtable'","Require stack:","- /var/task/proxy.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:1087:17)"," at async 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"]}
I’ve tried modifying the netlify.toml to include
[functions]
external_node_modules = ["airtable"]
but it didn’t help