-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Milestone
Description
What version of Next.js are you using?
10.0.7
What version of Node.js are you using?
14.12.0
What browser are you using?
Chrome, Safari, Firefox
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
The Next.js router is mistaking the index.js route as a dynamic route with a query of "index".
I have 2 pages:
- pages/index.js
- pages/[page].js with fallback
Occasionally when loading the index route, I am getting directed to the [page].js route which is returning as an error page.
The router at this point is looking like this:
{
"pathname": "/[page]",
"route": "/[page]",
"query": {
"page": "index"
},
"asPath": "/",
"components": {
"/[page]": {
"initial": true,
"props": {
"pageProps": {
"preview": false,
"pageData": {}
},
"__N_SSG": true
},
"__N_SSG": true
},
"/_app": {
"styleSheets": []
}
},
"isFallback": false,
"basePath": "",
"isReady": true,
"isLocaleDomain": false,
"events": {}
}
Expected Behavior
The index route should load consistently
To Reproduce
Create an index.js page and a dynamic route page with fallback: true.
Load the index route in the browser and refresh until it does not display.
My site can also be viewed for an example: https://cappellazzo-website-cvrquuxk8-homestudio.vercel.app/
reckter and mhlz
Metadata
Metadata
Assignees
Labels
No labels