NextJS 12 to 14 Upgrade - Query Data Insertion
Unanswered
Taco Dave posted this in #help-forum
Howdy. I'm trying to upgrade an application from NextJS 12 to 14. It uses the pages router and inserts data that needs to be rendered on the page by placing it in the query data like this:
However, after upgrading to 14, the page being rendered now only gets an empty string when trying to handle the initial properties of the page component:
Is there some other way I need to structure the insertion of the props since upgrading, or somewhere else in the context argument I should be looking?
I'm also open to restructuring the app to make this work. The tl;dr version of what we're trying to do is render a page with data POSTed from another app and use Puppeteer to output the rendered page as a PDF, and I'm having trouble making sense of the best way to do this -- it seems like maybe this wasn't the right stack to use for building a PDF generator but it's wayyyy too late to change. 😅
nextApp.render(req, res, `/Client/${FormId}`, { ...testData });However, after upgrading to 14, the page being rendered now only gets an empty string when trying to handle the initial properties of the page component:
export const getServerSideProps = async ({ query }) => ({
props: query.data
});Is there some other way I need to structure the insertion of the props since upgrading, or somewhere else in the context argument I should be looking?
I'm also open to restructuring the app to make this work. The tl;dr version of what we're trying to do is render a page with data POSTed from another app and use Puppeteer to output the rendered page as a PDF, and I'm having trouble making sense of the best way to do this -- it seems like maybe this wasn't the right stack to use for building a PDF generator but it's wayyyy too late to change. 😅