serverless-nextjs / serverless-next.js

⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
MIT License
4.46k stars 457 forks source link

SSG Redirect return JSON if page is directly accessed #2430

Open cmaerz opened 2 years ago

cmaerz commented 2 years ago

Issue Summary

When i access a SSG page that returns a redirect the JSON response is shown instead of the redirect made. The root cause of this is the PR #2393 from @KensukeTakahara i guess. image

Pretty sure there just needs to be a if some where.

Actual behavior

When a SSG page returns a redirect and you access it directly it returns JSON instead of the actual redirect response. When access the .json version of the page it should be fine. Can't test this currently.

Expected behavior

When access directly it should return the redirect response directly.

Steps to reproduce

  1. Return a redirect in getStaticProps
  2. Access the page directly

Versions

It works on 3.7.0-alpha.10 every version above breaks it.

cmaerz commented 2 years ago

@dphang Any Update here? Or a hint how to fix it? Imho thats a breaking change.

dphang commented 2 years ago

Sorry, I had missed this as i have gotten busier lately. Let me check on this this week and fix it, I think it was caused by a recent PR which we need to revert.

On Tue, May 10, 2022 at 1:26 AM Christian März @.***> wrote:

@dphang https://github.com/dphang Any Update here? Or a hint how to fix it? Imho thats a breaking change.

— Reply to this email directly, view it on GitHub https://github.com/serverless-nextjs/serverless-next.js/issues/2430#issuecomment-1122086289, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYSQFBW3YRXLTLUANOIGLLVJIMTLANCNFSM5T6GT65Q . You are receiving this because you were mentioned.Message ID: @.***>

cmaerz commented 2 years ago

@dphang Any Updates here?

jcricaro commented 2 years ago

@dphang up