You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this schema to test the content of a JSON value.
import{z}from"zod";constschema=z.object({name: z.string().refine((val)=>{constvalues=Object.values(JSON.parse(val));return(values.length>0&&values.some((v)=>typeofv==="string"&&v.length>0));},"You must fill in at least one language")});// errorschema.parse({name: '{""}'});schema.parse({name: '{"en":""}'});schema.parse({name: '{"en":"","fr":""}'});// successschema.parse({name: '{"en":"Game"}'});schema.parse({name: '{"en":"Game","fr":""}'});schema.parse({name: '{"en":"Game","fr":"Jeu"}'});
The schema works, but remix-params-helper does not seem to like it..
Error: Unexpected type ZodEffects for key name
at processDef (/Users/benjamin/Projects/horeka/node_modules/remix-params-helper/dist/cjs/helper.js:149:15)
at parseParams (/Users/benjamin/Projects/horeka/node_modules/remix-params-helper/dist/cjs/helper.js:19:9)
at getParamsInternal (/Users/benjamin/Projects/horeka/node_modules/remix-params-helper/dist/cjs/helper.js:50:9)
at getParams (/Users/benjamin/Projects/horeka/node_modules/remix-params-helper/dist/cjs/helper.js:84:12)
at action (/Users/benjamin/Projects/horeka/build/index.js:993:69)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.callRouteAction (/Users/benjamin/Projects/horeka/node_modules/@remix-run/server-runtime/data.js:36:14)
at async handleDataRequest (/Users/benjamin/Projects/horeka/node_modules/@remix-run/server-runtime/server.js:110:18)
at async requestHandler (/Users/benjamin/Projects/horeka/node_modules/@remix-run/server-runtime/server.js:45:20)
at async /Users/benjamin/Projects/horeka/node_modules/@remix-run/express/server.js:45:22
The text was updated successfully, but these errors were encountered:
I have this schema to test the content of a JSON value.
The schema works, but
remix-params-helper
does not seem to like it..The text was updated successfully, but these errors were encountered: