Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [V7] TypeScript error when action clients are exported with "declaration: true" is set in tsconfig #95

Closed
2 tasks done
ludwigbacklund opened this issue Apr 6, 2024 · 2 comments · Fixed by #96
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@ludwigbacklund
Copy link

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

When running next-safe-action v7 in a TypeScript project with "declaration: true" set in tsconfig.json, a TypeScript error occurs as soon as you try to export a created action client.

import { createSafeActionClient } from 'next-safe-action';

/** 
Property '_metadata' of exported class expression may not be private or protected.ts(4094)
Property 'handleReturnedServerError' of exported class expression may not be private or protected.ts(4094)
Property 'handleServerErrorLog' of exported class expression may not be private or protected.ts(4094)
Property 'middlewareFns' of exported class expression may not be private or protected.ts(4094) 
*/
export const actionClient = createSafeActionClient();

Reproduction steps

  1. Create a TypeScript/Next.js project with "declaration: true" in tsconfig.json
  2. Create an action client with createSafeActionClient
  3. Export it

Expected behavior

It should not error

Reproduction example

https://stackblitz.com/edit/stackblitz-starters-mvsrjh?file=app%2Faction-client.ts

Operating System

Ubuntu

Library version

7.0.0-next.14

Additional context

No response

@ludwigbacklund ludwigbacklund added the bug Something isn't working label Apr 6, 2024
@TheEdoRan TheEdoRan linked a pull request Apr 7, 2024 that will close this issue
@TheEdoRan
Copy link
Owner

TheEdoRan commented Apr 7, 2024

Please let me know if #96 (v7.0.0-next.15) fixed your issue, thanks!

@ludwigbacklund
Copy link
Author

Works great 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants