In a serverless function, the build passes but when I invoke the function, I get a FUNCTION_INVOCATION_FAILED.
In an edge function, the build failed with the following error:
Error: The Edge Function “api/index” is referencing unsupported modules:
- pusher: crypto, url
- tweetnacl: crypto
It sounds like your code is being deployed as Edge Function, not Serverless Function. Please note that there are certain limitations in place with Edge Functions that may need to be considered when using certain packages: Choosing a Runtime
I followed this example to create a nodejs function but I got the following error:
Error: api/index.mjs: config.runtime: "nodejs" semantics will evolve soon. Please remove the runtime key to keep the existing behavior.