TheEdoRan / next-safe-action

Type safe and validated Server Actions in your Next.js project.

Home Page:https://next-safe-action.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Errors with example from docs

nikitavoloboev opened this issue · comments

Are you using the latest version of this library?

  • I verified that the issue exists in the latest next-safe-action release

Is there an existing issue for this?

  • I have searched the existing issues and found nothing that matches

Describe the bug

image

in code of my project: https://github.com/kuskusapp/kuskus/blob/main/app/update-user-action.ts

not sure what's wrong

also I want to use server action here:

image

https://github.com/kuskusapp/kuskus/blob/main/components/routes/ProfileAuth.tsx#L52

can I inline server action somewhere inside the ProfileAuth route itself?

thanks

Reproduction steps

clone repo, check the types in the update-user-action.ts file

Expected behavior

no type errors

Reproduction example

https://github.com/kuskusapp/kuskus

Operating System

macOS

Library version

^6.2.0

Additional context

No response

You need to install the library with npm i next-safe-action@next if you want to use the v7 API. The problem is that you're using current stable version (v6). You can check out documentation for v6 here and for upcoming v7 here. Please note that v7 is currently in beta and APIs could change, thanks.