Receiving 404 page while trying to access route through direct link
Answered
aswnss posted this in #help-forum
aswnssOP
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.
The situation is same for all the routes.
28 Replies
how does your folder structure look like, and how does the code for a route look like?
ScreenRecord of the error
That looks odd. Can you try to delete the .next directory and restart the server?
aswnssOP
Let me try it
It is not helping , the error is not resolved
can you show me the code in blog/page.tsx?
aswnssOP
Yes , but this issue is not only blog page , but everyother route in my project.
hmm 🤔
looks alright to me
aswnssOP
also this issue is there in hosted website too
softservedweb.vercel.app
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
/ @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
aswnssOP
yep
what do you see in the console/terminal
aswnssOP
no errors
â—‹ Compiling /blog/page ...
✓ Compiled /blog/page in 13.8s (958 modules)
✓ Compiled in 533ms (631 modules)
✓ Compiled in 266ms (631 modules)
â—‹ 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 😵
its the "@footer" and "@navbar"
Answer
aswnssOP
that is causing it ? woah..
so how you are supposed to give navbar and footer , just like normal components
yes
aswnssOP
thank you , let me try that
aswnssOP
It works