-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Error: Cannot resolve "@aws-sdk/credential-providers" on edge worker functions #32
Comments
I havn't try it on edge but will do and try to find the problem, thanks for the issue 👍 |
Same for Cloudflare, after i installed @aws-sdk/credential-providers the module just required the next dependency, and the next and so on. Do you have any idea what could be the reason for this or have you perhaps already looked into it? |
Any news on this issue? Currently this problem blocks all deployments for us, is there a way I could support you to get this work again? Have you already looked into this problem? |
@nicokempe I'm so sorry but I don't have experience with edge, so I wasn't successful. I'll ask others, and if you have a solution PR is more than welcome. thanks |
Seems like the MongoDB package itself is not edge compatible. The dependencies that make problems are a sub-dependency of MongoDB and I have read on StackOverflow that this is not only known but not really possible without workarounds like a REST Relay... Vercel itself provides guidelines on making libraries compatible with their Edge Functions runtime. This includes using a subset of Web APIs like fetch, Request, and Response, and avoiding certain Node.js APIs and JavaScript features that are not supported in the Edge Runtime. For MongoDB specifically, it seems like you should use the MongoDB Data API, which is HTTP-based but they say "While it is not a full replacement for the MongoDB driver, it does provide a way to access MongoDB from a browser or edge-computing service like Cloudflare Workers" themselves so I dont know how good of an alternative that is.. I have just joined the unofficial MongoDB community Discord and opened a Ticket at MongoDB and asked if anybody knows if the MongoDB package is going to be edge support because I couldnt find any information about that References: |
@nicokempe Thanks Nico for the information and resources shared but let me ask you for a new update or any other workaround you have found on this issue. [info] [nitro] Building Nuxt Nitro server (preset: |
I have the same error with nuxthub and cloudflare with error call by not resolve something influrrent with "snappy" in mongodb. I have spent to much time for solution of mongoose using on cloudflare. Does have any solution, I got this solution, but I still unclean does it work, look complicated have lots of step to setup. https://www.mongodb.com/developer/products/atlas/cloudflare-worker-rest-api/ |
Personally I switched over to use Drizzle + PostgreSQL. On Cloudflare you can use Drizzle + Cloudflare D1 (NoSQL) |
Seem like sound good, I will try. Thank you MickL for the advise ❤ |
@whitersun you can try the stack in https://hub.nuxt.com/ |
yeah, nuxthub is something very cool, I was using nuxt to storage my data. I just confuse when unable to using mongodb. Hope something like zeabur, able to add mongodb and auto key to management. |
I have seen this just now I am sorry 😅, I have worked a week on the migration to Supabase because I couldn't get it to run on Cloudflare Pages with MongoDB. I am pretty happy with that decision now even though I prefer NoSQL databases like MongoDB over relational databases like PostgreSQL. |
Thanks, this plugin looks amazing! It works fine on my local dev but deploying to Vercel Edge Functions I get the following error:
I dont exactly understand why would it even need
@aws-sdk/credential-providers
?It works on my local dev and also when I deploy to normal Vercel (not to Edge Functions using
NITRO_PRESET="vercel-edge"
) it works just fine.The text was updated successfully, but these errors were encountered: