Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When running the edge function locally, everything works as expected. However, after deploying it to production, I receive a 404 error in the invocations section of the monitoring dashboard. The logs section does not display any information, making it difficult to diagnose the issue.
I suspect that the problem is related to the Langchain libraries included in the import_map.json file. I identified this by commenting out all imports and then uncommenting them one by one until the error reappeared. Previously, I encountered a similar issue and resolved it by adjusting the import sources (some libraries were imported from npm, others from esm). However, this time, I have tried multiple sources, but the problem persists.
To Reproduce
Steps to reproduce the behavior:
- Deploy the edge function with Langchain libraries included in the import_map.json file.
- Attempt to invoke the function in the production environment.
- Check the invocations section in the monitoring dashboard and observe the 404 error.
- Notice that no logs are generated in the logs section.
Expected behavior
The edge function should execute successfully without a 404 error, and logs should be generated to assist in troubleshooting.
Screenshots
System information
- OS: [e.g. macOS, Windows]
- Browser (if applies) [e.g. chrome, safari]
- Version of supabase-js: [e.g. 6.0.2]
- Version of Node.js: [e.g. 10.10.0]
Additional context
To rule out potential network issues related to accessing npm and esm in different regions, I created a separate project and deployed it in another country, but the issue persisted.
import_map.json
{
"imports": {
"axios": "npm:axios@1.6.8",
"zod": "https://deno.land/x/zod@v3.23.4/index.ts",
"djwt": "https://deno.land/x/djwt@v3.0.2/mod.ts",
"zod/types": "https://deno.land/x/zod@v3.23.4/types.ts",
"cron-parser": "https://esm.sh/cron-parser@4.9.0",
"@langchain/openai": "https://esm.sh/@langchain/openai@0.2.5",
"@langchain/langgraph": "npm:@langchain/langgraph@0.0.31",
"@langchain/langgraph/prebuilt": "npm:@langchain/langgraph@0.0.31/prebuilt",
"@langchain/core": "npm:@langchain/core@0.2.18",
"@langchain/core/tools": "npm:@langchain/core@0.2.18/tools",
"@langchain/core/agents": "npm:@langchain/core@0.2.18/agents",
"@langchain/core/prompts": "npm:@langchain/core@0.2.18/prompts",
"@langchain/core/messages": "npm:@langchain/core@0.2.18/messages",
"@langchain/core/runnables": "npm:@langchain/core@0.2.18/runnables",
"@langchain/core/callbacks/manager": "npm:@langchain/core@0.2.18/callbacks/manager",
"@langchain/core/utils/function_calling": "npm:@langchain/core@0.2.18/utils/function_calling"
}
}