-
Notifications
You must be signed in to change notification settings - Fork 28
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 with client using Vercel Edge Function #14
Comments
Just had an idea: is it maybe because the client uses |
We're actively working on supporting both ESM and new runtimes like vercel edge functions, netlify deno workers and more. You can test the new client using this command: |
Hi, could you try with |
Seems fine! Cannot really say since when but haven't got this error for a while. |
I'm facing a different problem when deploying on the Vercel edge functions:
Tested with the |
@stipsan, Hello - on Netlify (this time) Edge functions, the 'url' fix you gave of using @sanity/client@5.0.0 appears to work; at least it compiles. But with it, I can't get further because now there is a similar fail for the 'http' function, messages below. Would you like me to make another issue for the Thanks, Netlify log fragment:
|
@stipsan -- happened across this link when discovering about the problem initially, and it has good discussion w/code for doing the equivalent of http listen in Deno. Much better than what seems to be needed in the other direction of conversion! And so I'm thinking it would just take some conditional code after recognizing whose edge service you were on. Maybe just testing a dynamic include could say?? |
@stipson, I looked into this a little farther, and think I have a fix for you, low risk and very easy, if you agree. In fact, we could wonder what npm module I didn't spot where you may have removed There's actually an http ability in there, and if it were functional enough could be selected by using a little code based on dynamic package imports, but this is surely not an appropriate effort here, is it? So I propose that you simply tell the publishing step not to include the /text folder at all. This is one more kind of fraught business, but in this case the simplest seems to be to use an Because that file completely blanks npm's automatic ignoring of what's in .gitignore, you'd need to copy .gitignore's contents into .npmignore, then add a I could do a PR for this if you'd like -- have stopped here short of messing with my own publish in the npm namespace, which would be necessary to prove this for Netlify's build.... |
Hmmm it seems like the bundling for Vercel's Edge is somehow ending up with the
Could you share more information on your bundler setup?
It's not just in test fixtures. The http module is used when the client is bundled for a
The Vercel Edge runtime is part of our E2E test suite: If you can share your setup I'd love to add it to the rig @narration-sd :) And PRs are of course welcome! |
@stipsan I've just tried the new @vercel/remix integration (see announcement post), and |
@hdoro that's great news! ✨ |
@stipsan I need to correct that: I don't know how it worked on the successful project I mentioned above, but new projects aren't working. I've tried For now I'm replacing my only instance of |
@hdoro That's unfortunate indeed. The issues we've been seeing are so far consistently bundling related. For whatever reason the |
Vercel Edge Functions are still in beta but that sounds like a Sanity issue here: I'm running a SvelteKit project using the Sanity Client to make queries on Page Endpoints through a function, and this is the error that I get from the Vercel logs:
More infos: https://vercel.com/docs/concepts/functions/edge-functions
Possible limitations (Node related?): https://vercel.com/docs/concepts/functions/edge-functions/middleware-api#unsupported-apis-and-runtime-restrictions
The text was updated successfully, but these errors were encountered: