-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Attempted to call validateAndNormalizeDocument() from the server [fields-document] #8717
Comments
WorkaroundThe only workaround I've found right now is to temporarily put the
|
Hey @Thinkscape thanks for the info, just to confirm this is only when you use |
I don't fully understand what you mean by My route handler is very similar to yours here, i'm also using const handler = startServerAndCreateNextHandler<NextRequest>(apolloServer, {
context: async () => getServerActionContext(),
}) There's nothing special in the implementation. It only breaks if I |
Tried reverting #8403 but then it breaks in other places 🤔 Maybe the validator needs to be split into two different versions? (one of them with |
Yes, without #8403, it was impossible to use the document field with |
When solving similar problems in my apps, I'd usually extract the logic into a isomorphic lib/component, then import it from either server/client consumers. Quite common for stuff like validation, which works surprisingly smoothly with isomorphic zod schemas 🤔 (I use one schema across react-hook-form, gql mutation handlers, inngest functions etc.) |
@borisno2 I was just hit with this issue too, after using app router I'm unable to update fields which use the |
@Thinkscape @borisno2 I am still having the same issue even tough I have the same code as @borisno2 but still gives me error when creating a new blog post for example, the error is:
That also giving me issue with contentBlocks which might be different matter but still document field is troublesome when used with Keystone-Nextjs monorepo Do you guys have any solution for that ? Thanks in advance! Update: I have worked with pages router since it seems the only thing that works with document field and its customizations and everything works fine, but uploading image while disabling bodyParser of next js gives this weird error
Let me know if you guys have a solution for that! thanks |
Well this is weird, using pages router works with document field but messes my custom image upload based on @borisno2 example of vercel/blob but I am using uploadthing instead and upload gives me 2 errors: 1- This happens with graphql-yoga when having bodyParser as false
2- This happens when using @as-integrations instead of graphql-yoga
Any thing regarding that ? |
Summary
I believe this is a regression after #8403 @borisno2
After adding
"use client"
to packages/fields-document/src/validation.ts, things break server-side when validation is triggered by admin hooks.Steps
[email protected]+
app using App Router (defaultnext.config.ts
).content: document({})
Expected
I can add a list with document field.
Actual
The text was updated successfully, but these errors were encountered: