-
Notifications
You must be signed in to change notification settings - Fork 126
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
Leading slash redirects not working for next server actions (but does work locally) #396
Comments
Can you reproduce this locally via |
Hi there - I'm seeing this issue as well. I tried the above suggestion w/r/t 'standalone mode': I just tried building ( I'm using SST v2.41.4 and its default v2.3.7 version of open-next. When I see this in a production AWS environment, it manifests for me as:
If I modify the |
Tested this in V3, it works just fine there for me. |
Hi @conico974, Here is a reproducible demo for this issue. SST v2.41.5 The demo is created via pnpm create next-app
pnpm create sst To start local dev pnpm sst dev
pnpm run dev Deploy staging env pnpm sst deploy --stage staging my staging demo: https://d11lu0si5g9k8u.cloudfront.net/ Local Env: both server actions(withLeadingSlash and withoutLeadingSlash) work. server action in I haven't try with open-next V3. I use open-next indirectly via SST. Is it possible to use different version of open-next with SST? |
You'll need to apply this patch until the PR is merged: sst/sst#3567 |
Fixed in V3 |
I spent some time trying to figure out why a redirect from a server action wasn't working. What made this more difficult was the fact that it works just fine locally, but when I deploy it to AWS the redirect does not work if there's a leading slash.
Absolute URLs work just fine, and removing the leading slash makes it work.
I've reduced this down to literally just a redirect in the server action itself, and the issue seems consistent for me.
If you have a server action inside it with literally nothing more than:
This doesn't work when deployed, but does locally.
But if I do:
It's working just fine.
I'm using SST
2.41.2
. All routes are based on the app dir. I'm on next14.1.4
.The text was updated successfully, but these errors were encountered: