-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Receiving 404 when calling edge function with langchain libraries in import_map.json #401
Comments
I have run into the same problem. |
Thanks for reporting! Which module in particular is causing the 404? Transferring to edge functions repo for visibility |
I noticed that the error mainly occurs because of @langchain/openai which under the hood simply uses openai |
I also built all the libraries manually and linked to my builds on GitHub and now everything works fine in production my current import_map.json
|
and everything breaks if I don't specify these two libraries from the openai repository, although logically there should be the same code on npm, esm, and github. Perhaps the problem is with how edge runtime works with these cdn |
Bug report
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:
Expected behavior
The edge function should execute successfully without a 404 error, and logs should be generated to assist in troubleshooting.
Screenshots
System information
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
The text was updated successfully, but these errors were encountered: