How do I switch a Next.js project from using App Router to Pages Router?
Answered
Australian Freshwater Crocodile posted this in #help-forum
Australian Freshwater CrocodileOP
I went along with the recommended option of using App Router, but it's causing much trouble such as Auth0 does not support it, and I would like to switch back to using Pages Router. Is there perhaps a config file I could edit to switch the default routing method being used?
3 Replies
@Australian Freshwater Crocodile I went along with the recommended option of using App Router, but it's causing much trouble such as Auth0 does not support it, and I would like to switch back to using Pages Router. Is there perhaps a config file I could edit to switch the default routing method being used?
Remove the app directory, add the pages directory, done
Answer
Add maybe
export default function Page() {
return <div>Hello world</div>
}
to pages/index.tsx and access localhost:3000
export default function Page() {
return <div>Hello world</div>
}
to pages/index.tsx and access localhost:3000
@joulev Remove the app directory, add the pages directory, done
Australian Freshwater CrocodileOP
Much thanks joulev, that solves the issue!