Replies: 1 comment 14 replies
-
Hi @SiddhantJ007, do you have a custom If so, are you passing MyApp.getInitialProps = async (appContext) => {
// calls page's `getInitialProps` and fills `appProps.pageProps`
const appProps = await App.getInitialProps(appContext);
return { ...appProps }
} Edit: It should be: export async function getServerSideProps(context) {
const { whiteboardEvents, lesson } = context.query;
return {
props: {
whiteboardEvents: whiteboardEvents || null,
lesson: parse(stringify(lesson)),
},
};
}
LessonPage.getInitialProps = async context => {
const { whiteboardEvents, lesson } = context.query;
return {
whiteboardEvents,
lesson,
};
}; |
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Previously I was using the NextJs v9.4.4, in that version getInitialProps was working fine but after upgrading it to the latest version I was getting an error which says: context.req is undefined.
Here is the code snippet in which I was getting error:
Beta Was this translation helpful? Give feedback.
All reactions