[X] I verified that the issue exists in the latest next-safe-action release
Is there an existing issue for this?
[X] I have searched the existing issues and found nothing that matches
Describe the bug
I get this error from tsserver:
Argument of type 'ObjectSchema<{ readonly MyField: StringSchema<undefined>; }, undefined>' is not assignable to parameter of type 'ZodType<any, ZodTypeDef, any> | ((prevSchema: undefined) => Promise<ZodType<any, ZodTypeDef, any>>)'. [2345]
export const createSomething = action
.schema(createSchema)
.action(async function ({ parsedInput }) {
// parsedInput is of type unknown
});
The error I get is this:
Argument of type 'ObjectSchema<{ readonly MyField: StringSchema; }, undefined>' is not assignable to parameter of type 'ZodType<any, ZodTypeDef, any> | ((prevSchema: undefined) => Promise<ZodType<any, ZodTypeDef, any>>)'. [2345]
It looks like it's expecting a zod type
### Expected behavior
I expected to work with valibot
### Minimal reproduction example
The code is in the description of the issue
### Operating System
Linux
### Library version
7.1
### Next.js version
14.2.4
### Additional context
_No response_
Hey @pedro757, please try to update to the latest stable release and set up validation with Valibot. Now next-safe-action ships with built-in support for multiple validation libraries. Related discussion here and docs page here.
Are you using the latest version of this library?
Is there an existing issue for this?
Describe the bug
I get this error from tsserver:
Reproduction steps
import { string, object } from "valibot";
const createSchema = object({ MyField: string(), });
export const createSomething = action .schema(createSchema) .action(async function ({ parsedInput }) { // parsedInput is of type unknown });
Argument of type 'ObjectSchema<{ readonly MyField: StringSchema; }, undefined>' is not assignable to parameter of type 'ZodType<any, ZodTypeDef, any> | ((prevSchema: undefined) => Promise<ZodType<any, ZodTypeDef, any>>)'. [2345]