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

NextJS crashes when importing an action from a 'use server' file with: TypeError: private_next_rsc_action_validate__WEBPACK_IMPORTED_MODULE_1__ is not a function #54230

Closed
1 task done
samijaber opened this issue Aug 18, 2023 · 1 comment · Fixed by #54254
Assignees
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked

Comments

@samijaber
Copy link
Contributor

samijaber commented Aug 18, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.13.0
      npm: 8.19.3
      Yarn: 1.22.19
      pnpm: 7.26.2
    Relevant Packages:
      next: 13.4.18-canary.0
      eslint-config-next: 13.4.18
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

App Router

Link to the code that reproduces this issue or a replay of the bug

https://github.com/samijaber/nextjs-repro-issues/tree/acb3a6e50bca8b0c9933ac440234b9eef498c93d

To Reproduce

You will see this:

CleanShot 2023-08-18 at 11 57 27@2x

Describe the Bug

NextJS is unable to import some validate function related to server actions.

NOTE: the files in src result from bundling a library using vite/rollup. This is why they don't necessarily look like how a human would write them. My real-case issue is around bundling an npm package for consumption by NextJS, so this is why I am showing the bug occurring in this particular format.

Expected Behavior

NextJS should be able to load the import

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-1534

@samijaber samijaber added the bug Issue was opened via the bug report template. label Aug 18, 2023
@shuding shuding self-assigned this Aug 18, 2023
@shuding shuding added the linear: next Confirmed issue that is tracked by the Next.js team. label Aug 18, 2023
shuding added a commit that referenced this issue Aug 20, 2023
Similar to #54004, this PR changes `private-next-rsc-action-validate`
and `private-next-rsc-action-client-wrapper` to export named values
instead of default values. In #54230 (currently broken), the Server
Action file was bundled via Vite/Rollup as an external dependency so
we're not doing the ESM interoperation correctly.

Closes #54230.
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Sep 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants