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

Server actions no longer working when developing using local version of Next.js #57054

Closed
1 task done
viktorronnback opened this issue Oct 19, 2023 · 4 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template. locked

Comments

@viktorronnback
Copy link
Contributor

Link to the code that reproduces this issue

https://github.com/viktorronnback/server-actions

To Reproduce

  1. Clone the reproduction repository provided above
  2. Follow the steps in the Developing Using Your Local Version of Next.js guide (either Develop inside the monorepo or Set as a local dependency in package.json)
  3. Go to http://localhost:3000/
  4. Press the Action button
  5. Notice the terminal output

Current vs. Expected behavior

A console log "Hello World!" should be printed in the terminal, instead Failed to find Server Action "[server action id]". This request might be from an older or newer deployment. is shown. Server actions work as usual on canary and release versions (when not using the local version of Next.js) so this is only an issue when using local version of Next.js.

Verify canary release

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

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #34~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep  7 13:12:03 UTC 2
Binaries:
  Node: 18.18.2
  npm: 10.2.0
  Yarn: N/A
  pnpm: 8.9.0
Relevant Packages:
  next: 13.5.6
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: N/A
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

Server actions stopped working after v13.5.5-canary.3 (throws an error). After v13.5.5-canary.5 Failed to find Server Action "[server action id]". This request might be from an older or newer deployment. is shown in the terminal (probably #56618).

This is a somewhat minor issue, but it is hard to diagnose issues related to server actions if this does not work (unless there is some workaround or other way of making server actions work when developing with a local version of Next.js).

@viktorronnback viktorronnback added the bug Issue was opened via the bug report template. label Oct 19, 2023
@KryptXBSA
Copy link

KryptXBSA commented Oct 20, 2023

I've cloned your repository and tested it with canary version 13.5.7-canary.11, and it worked as expected.

I've also tested it on v13.5.5-canary.3 and v13.5.5-canary.5, and it still worked as expected. So there might be a possibility that the issue is specific to your local environment.

@viktorronnback
Copy link
Contributor Author

Sorry my bad, it was my local version. It now works after I ran pnpm clean.

However I feel like there should be a mention of the need to run this command when switching versions/pulling down new changes in any of the contributing-guides. I can submit a PR with suggested additions to the docs.

@balazsorban44
Copy link
Member

closing as per the above

Copy link
Contributor

github-actions bot commented Nov 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 Nov 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 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. locked
Projects
None yet
Development

No branches or pull requests

3 participants