Next.js Discord

Discord Forum

Can you change from the App router to Pages router and viceversa?

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
I started a project using the App router, but later preferred to use the Pages router, so I tried adding and removing all the necessary files and folders that are necessary for the a normal Pages router. However, it doesn't seem to be working when I run it and it gives me an error. Do I have to redo the project in Pages router?

2 Replies

Transvaal lionOP
I added the
reactStrictMode: true,
to the next.config.js file and it worked. I forgot this one bit. You can change it viceversa. Remove reactStrictMode: true, from next.config.js for App router.
Crème D’Argent
Calling api in App directory ssr page, want to Extend client http request header to api call, how can i do that ?? any referance??