Skip to content

Cannot run Server Actions in GitHub Codespaces or VSCode Tunnel #58019

Description

@waki285

Link to the code that reproduces this issue

https://github.com/waki285/Server-Actions-Bug

To Reproduce

  1. Clone the repository in GitHub Codespaces or VSCode Tunnel.
  2. Start the server with next dev.
  3. Codespaces (or VSCode Tunnel) will automatically perform port forwarding and you can access the launched website through it.
  4. Click the "Execute Server Actions" button.
  5. An error will occur.

Current vs. Expected behavior

Expected:
Server Actions are executed successfully and no errors occur.

Current:
The following error occurs

`false` header with value `********-3000.***.devtunnels.ms` does not match `origin` header with value `localhost:3000` from a forwarded Server Actions request. Aborting the action.
 ⨯ Error: Invalid Server Actions request.
    at AsyncLocalStorage.run (node:async_hooks:346:14)
    at AsyncLocalStorage.run (node:async_hooks:346:14)

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: #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022
Binaries:
  Node: 20.9.0
  npm: 10.2.2
  Yarn: N/A
  pnpm: 8.10.2
Relevant Packages:
  next: 14.0.2-canary.11
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

App Router

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions