You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
First of all, I would like to thank you for the excellent work you have been doing with this library. However, I am facing an issue in my new project.
When I try to run my tests (just a simple test), it returns this error within the dist of safe-action. I noticed that a similar issue was opened in the past and resolved, but the problem seems to have returned:
These are the dependencies I am using:
Reproduction steps
add the library
try to run a base unit test
is also important to say that the page.tsx is a server component and the SearchArea.tsx is a client component.
this the unit test that is breaking:
Expected behavior
the test should pass
Minimal reproduction example
private repo
Operating System
macOS
Library version
7.8.0
Next.js version
14.2.5
Node.js version
21.7.3
Additional context
No response
The text was updated successfully, but these errors were encountered:
If I change all the imports and exports in the hook.mjs and index.mjs resolves the problem, but I don't know what will impact the library structure....
freirepaulo
changed the title
[BUG] Nextjs 14 run test with erro "SyntaxError: Cannot use import statement outside a module"
[BUG] Nextjs 14 run jest test with erro "SyntaxError: Cannot use import statement outside a module"
Aug 30, 2024
TheEdoRan
changed the title
[BUG] Nextjs 14 run jest test with erro "SyntaxError: Cannot use import statement outside a module"
[BUG] Jest error "SyntaxError: Cannot use import statement outside a module"
Aug 30, 2024
Vitest should be a better testing framework though, if you can switch to it. Let me know if setting that option fixes the issue for you as well, thanks!
Are you using the latest version of this library?
Is there an existing issue for this?
Describe the bug
First of all, I would like to thank you for the excellent work you have been doing with this library. However, I am facing an issue in my new project.
When I try to run my tests (just a simple test), it returns this error within the dist of safe-action. I noticed that a similar issue was opened in the past and resolved, but the problem seems to have returned:
These are the dependencies I am using:
Reproduction steps
is also important to say that the page.tsx is a server component and the SearchArea.tsx is a client component.
this the unit test that is breaking:
Expected behavior
the test should pass
Minimal reproduction example
private repo
Operating System
macOS
Library version
7.8.0
Next.js version
14.2.5
Node.js version
21.7.3
Additional context
No response
The text was updated successfully, but these errors were encountered: