next-runtime icon indicating copy to clipboard operation
next-runtime copied to clipboard

Client redirect to static page does not work

Open faiare opened this issue 2 years ago • 1 comments

I have created a small example. https://codesandbox.io/s/goofy-allen-jixz0k?file=/pages/index.js

/destination1 (getServerSideProps is defined which returns empty json): redirect works fine.

import { handle, json } from "next-runtime";

export const getServerSideProps = handle({
  get: async () => {
    return json({});
  }
});

export default function ClientRedirect() {
  return <p>The redirect has landed. 🚀</p>;
}

/destination2 (getServerSideProps is not defined): redirect does not work.

export default function ClientRedirect() {
  return <p>The redirect has landed. 🚀</p>;
}

Both of these work when using <form> request.

faiare avatar Jul 13 '22 08:07 faiare

I faced same problem.

junseinagao avatar Feb 07 '23 05:02 junseinagao