Next.js Discord

Discord Forum

"npm run dev" displays a 404 page for all routes?

Unanswered
Chausie posted this in #help-forum
Open in Discord
ChausieOP
0

I'm encountering an issue where running npm run dev displays a 404 page for all routes in my Next.js 13 application. I suspect the problem originated when I was clicking on the sign-out button for the first time after adding the feature using next-auth. Interestingly, the terminal doesn't provide any errors, leaving me puzzled about the root cause.

To troubleshoot, I've tried the following:

Running npm run build && npm start and just npm start, but the problem persists. Deleting the .next folder and running npm install again, but this didn't resolve the issue either. you can find the following necessary code on the stackoverflow question i posted: https://stackoverflow.com/questions/77107203/npm-run-dev-displays-a-404-page-for-all-routes?noredirect=1#comment135939002_77107203

1 Reply

Are you using middleware?