-
Notifications
You must be signed in to change notification settings - Fork 14
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
validate
function breaks Next.js edge runtime
#54
Comments
hey, @TheEdoRan! thanks for investigating and reporting! I spent some time looking on this and learned that the Edge runtime has a limited API, which doesn't support dynamic imports ( The thing is that typeschema heavily relies on those to allow for optional peer dependencies. But while they're what make typeschema technically possible, bundler support can be a bit spotty, causing issues like this. The best path forward long term would be to move away of dynamic imports. Though I haven't yet found a way to do it without setbacks to the developer experience and/or treeshaking. I'll leave this issue open for now and focus on an alternative for dynamic imports. |
Yeah, moving away from dynamic imports would probably result in a worse DX. As I said in the OP, though, Vercel is apparently abandoning edge runtime in favor of PPR (Partial Prerendering), which I think is much better; edge runtime has always been very limited and unpleasant to use, but that's just my take. Now, I don't know if this will ever happen, but I think they understood that it isn't really the best rendering/compute model going forward. What I'll do with next-safe-action (at least for now) is export a copy of the "safe action client" instance from Please let me know your thoughts about this, and once again, thanks for your work with this amazing library @decs! |
Hi, a user of next-safe-action reported a bug with the edge runtime, where the action execution breaks with this error when client input(s) get validated and parsed:
I created a repo with a minimal reproduction of the issue, which appears to be directly related to TypeSchema
validate
function.Now, apparently Vercel is abandoning edge rendering and I don't know if this "bug" is easily fixable, so please let me know if I can do something to help solving this one, if possible.
Here's the original issue opened in next-safe-action repo:
Thanks!
Upvote & Fund
The text was updated successfully, but these errors were encountered: