Next.js Discord

Discord Forum

Receiving 404 page while trying to access route through direct link

Answered
aswnss posted this in #help-forum
Open in Discord
I am being redirected to 404 page while I try to access the route through typing url in the address bar , but it works fine while i access the same page through Link from navbar (or anyother Link from home page).

The situation is same for all the routes.
Answered by KINXZ
its the "@footer" and "@navbar"
View full answer

28 Replies

how does your folder structure look like, and how does the code for a route look like?
This is folder structure
-app
--blog
---page.tsx (blog page)
--page.tsx (app page)
ScreenRecord of the error
That looks odd. Can you try to delete the .next directory and restart the server?
Let me try it
It is not helping , the error is not resolved
can you show me the code in blog/page.tsx?
Yes , but this issue is not only blog page , but everyother route in my project.
hmm 🤔
looks alright to me
also this issue is there in hosted website too
softservedweb.vercel.app
softservedweb.vercel.app/blog
this is my config file
/ @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'picsum.photos',
port: '',
// pathname: '/account123/
',
},
],
},
}

module.exports = nextConfig
there is something weird going on, because i can see it loading first
yep
what do you see in the console/terminal
no errors

â—‹ Compiling /blog/page ...
✓ Compiled /blog/page in 13.8s (958 modules)
✓ Compiled in 533ms (631 modules)
✓ Compiled in 266ms (631 modules)
do you have a github repo so i can try it locally? Hard to say what the culprit is 😵
yep
its the "@footer" and "@navbar"
Answer
that is causing it ? woah..
so how you are supposed to give navbar and footer , just like normal components
yes
thank you , let me try that
It works