Closed B33fb0n3 closed 4 months ago
Does this solve your issue?
Yes, that solved the issue. Thanks! I saw, that I am using .d.ts files. What will happen to them? It seems right now to not have any impact, but maybe in the future?
It seems right now to not have any impact, but maybe in the future?
That seems to be a TypeScript issue with pnpm, and it affects multiple projects, so unfortunately I don't have an answer for that. However, I think that next-safe-action v7 could solve this issue, since it's a complete rewrite of the library. I recommend to install next-safe-action@next
for upcoming v7 to see if the error goes away. Docs are updated and can be found here. I'm just waiting for Next.js 14.3.0 stable release to merge next
branch into main
. Hope this helps!
I tried to fix it using the v7 version, but the issue still persists. Maybe it's fixed in the future, because I love this next-safe-action ^^
https://github.com/TheEdoRan/next-safe-action/issues/124#issuecomment-2110172864 It worked for me, thanks
Are you using the latest version of this library?
Is there an existing issue for this?
Describe the bug
When I install next-safe-action via
pnpm add next-safe-action
everything is fine. When I now add the correct code from the documentation inside mysafe-action.ts
:I will get the following error: TS2742: The inferred type of actionClient cannot be named without a reference to .pnpm/@decs+typeschema@0.12.2_zod@3.23.8/node_modules/@decs/typeschema . This is likely not portable. A type annotation is necessary.
It seems like it's not typed correctly. How to resolve that?
Reproduction steps
safe-action.ts
export const actionClient = createSafeActionClient();