Next.js Discord

Discord Forum

How to add a loader to wait the page in NextJS 13 using pages router and getServerSideProps?

Answered
Gharial posted this in #help-forum
Open in Discord
GharialOP
I have an application using NextJS v.13.2.3 and I have using the PAGES ROUTER. I want to know, how I can create a loader while I get a page which use a ServerSideProps, I want a solution like the file loading in the APP-ROUTER if it exists or how I can create the loader
Answered by joulev
As far as I know it’s impossible
View full answer

8 Replies

Answer
That’s one of the fundamental problems in the pages router that the app router solved by embracing the streaming architecture
GharialOP
Oh, at the moment I cannot do the migration to App Router, the project is huge.😩
Well… what to do
It’s just impossible
GharialOP
Do you know how to do a progressive migration? As I know the getServerSideProps doesn't work in App Router, does it?
@Gharial Do you know how to do a progressive migration? As I know the getServerSideProps doesn't work in App Router, does it?
Yes incremental migration is possible so you can have one single page in the app router and all other pages in the pages router. Refer to this guide https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration it also documents how to migrate getserversideprops