next-runtime
next-runtime copied to clipboard
Client redirect to static page does not work
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.
I faced same problem.