All routes go to 404
Answered
Transvaal lion posted this in #help-forum
Transvaal lionOP
New project. All I have done is add a custom 404. No pages directory.
Project dir attached.
Also as an aside, how many other people have had issues with routing? We're going to be deploying something with a very low tolerance for chaos in what amounts to stateful HTML and JS at the end of the day. We haven't done much and already running into ambiguous issues with no logging so... curious as to whether routing is a complicated part of NextJS or not. We very readily assumed this would not be a hurdle.
Project dir attached.
import React from 'react';
const About = () => {
console.log("About page is being rendered");
return <div>About Page</div>;
};
export default About;/** @type {import('next').NextConfig} */
const nextConfig = {
}
module.exports = nextConfiglocalhost:3000/about -> 404. all pages which aren't the homepage or 404 -> 404Also as an aside, how many other people have had issues with routing? We're going to be deploying something with a very low tolerance for chaos in what amounts to stateful HTML and JS at the end of the day. We haven't done much and already running into ambiguous issues with no logging so... curious as to whether routing is a complicated part of NextJS or not. We very readily assumed this would not be a hurdle.
31 Replies
Transvaal lionOP
It was. 404 was an experiment.
404.tsx only work in pages folder
Transvaal lionOP
I will do it again and screenshot results.
My custom 404 does work. Nothing but that and the homepage do.
story in 3 photos.
Transvaal lionOP
And this documentation refers to...
https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts
?
https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts
?
Transvaal lionOP
/pages methodology only?ah
Transvaal lionOP
Fascinating.
I have never seen such a thing in documentation before.
Thank you.
lol
Transvaal lionOP
is this due to Next13 changes basically?
forking the process for routes in 14+?
yes because the new router
Transvaal lionOP
Wow.
What a codebase.
Thank you again.
np
Transvaal lionOP
Hey. Decided to move away from NextJS. Has changed in some ways since I last checked up on it. Was pretty shocked at some patterns and how long it's taking to do basic things.
https://news.ycombinator.com/item?id=38018217
Wanted to share this for perspective. I pretty much agree with everything in there. It's not a strong framework for building quickly anymore. Authentication is taking way too long to design and it has nothing to do with the core competency of my app.
I mean nothing negative, I swore by NextJS just 2 years ago. Now I'm not so sure. Pretty confusing what has happened. I hope the team is doing great.
https://news.ycombinator.com/item?id=38018217
Wanted to share this for perspective. I pretty much agree with everything in there. It's not a strong framework for building quickly anymore. Authentication is taking way too long to design and it has nothing to do with the core competency of my app.
I mean nothing negative, I swore by NextJS just 2 years ago. Now I'm not so sure. Pretty confusing what has happened. I hope the team is doing great.