TheEdoRan / next-safe-action

Type safe and validated Server Actions in your Next.js (App Router) project.
https://next-safe-action.dev
BSD 3-Clause "New" or "Revised" License
1.33k stars 26 forks source link

[BUG] Errors with example from docs #112

Closed nikitavoloboev closed 1 week ago

nikitavoloboev commented 1 week ago

Are you using the latest version of this library?

Is there an existing issue for this?

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

TheEdoRan commented 1 week ago

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.