Cors-like error in server actions + github codespaces

Hey, for various reasons I some times use github codespaces to develop. I’m struggling with this error when calling server actions from the client.
`x-forwarded-host` header with value `domain…-3000.app.github.dev` does not match `origin` header with value `localhost:3000` from a forwarded Server Actions request. Aborting the action.
POST /testing 500 in 7ms
Error: Invalid Server Actions request.
at AsyncLocalStorage.run (node:async_hooks:346:14)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: "4009385968"
`x-forwarded-host` header with value `domain…-3000.app.github.dev` does not match `origin` header with value `localhost:3000` from a forwarded Server Actions request. Aborting the action.
POST /testing 500 in 7ms
Error: Invalid Server Actions request.
at AsyncLocalStorage.run (node:async_hooks:346:14)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: "4009385968"
Solution:
Solved, needed both the domain and localhost in allowed origins…
Jump to solution
2 Replies
Sylte
SylteOP2d ago
I have no issues when running locally and I’ve tried to update allowedOrigins and trustedHosts for serverActions in the nextjs config
Solution
Sylte
Sylte2d ago
Solved, needed both the domain and localhost in allowed origins…
Want results from more Discord servers?
Add your server