TheEdoRan / next-safe-action

Type safe and validated Server Actions in your Next.js project.
https://next-safe-action.dev
MIT License
2.29k stars 35 forks source link

[BUG] Module not found when using latest version #204

Closed simonri closed 3 months ago

simonri commented 3 months ago

Are you using the latest version of this library?

Is there an existing issue for this?

Describe the bug

After updating from 7.1.3 to 7.2.1 I get the following error:

 ⨯ ./node_modules/next-safe-action/dist/index.mjs:1:1
Module not found: Can't resolve './adapters/zod'
> 1 | import { zodAdapter } from "./adapters/zod";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2 | import { SafeActionClient } from "./safe-action-client";
  3 | import { DEFAULT_SERVER_ERROR_MESSAGE } from "./utils";
  4 | import {

Reproduction steps

Server action with zod schema.

Expected behavior

No error.

Minimal reproduction example

Private repo

Operating System

Windows 11

Library version

v7.2.1

Next.js version

15.0.0-canary.72

Additional context

No response

TheEdoRan commented 3 months ago

Need a minimal reproduction example, because I can run and build the project fine, even with Next.js 15:

image

simonri commented 3 months ago

Okay I'll see if I can make one. The project I'm using it for is private.

TheEdoRan commented 3 months ago

Yeah, but I need a link to a repo to investigate on this issue, otherwise it's pretty difficult, since it works fine for me. Should be pretty easy to set up a minimal project.

TheEdoRan commented 3 months ago

Update: please let me know if v7.2.2-beta.1 solves your issue, thanks. You can install it with:

npm i next-safe-action@beta # or pnpm, yarn

I re-enabled bundling, Windows might not like it turned off.

simonri commented 3 months ago

The issue only happens when using --turbo. The same code without --turbo works. After upgrading to v7.2.2-beta.1 turbo mode works as well. Thanks!

TheEdoRan commented 3 months ago

The issue only happens when using --turbo. The same code without --turbo works.

Ah, that's very interesting, thank you for your feedback! Gonna merge beta into main right now and release v7.2.2 stable.

simonri commented 3 months ago

Here is the reproduction repo if needed: https://github.com/simonri/next-reproduction

TheEdoRan commented 3 months ago

Thank you!

github-actions[bot] commented 3 months ago

:tada: This issue has been resolved in version 7.2.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: