Page props not passed for Index page when Middleware and basePath in use
gavb17 opened this issue · 1 comments
gavb17 commented
Link to the code that reproduces this issue
https://github.com/gavb17/next-index-bug
To Reproduce
npm run dev
- Open index route under
basepath
in browser, text on page shows value of prop being passed "Page #" - Use text to click through to second page, works as expected "Page #"
- Click link on second page to go back to
index
, page loads but passed prop does not show in text (no "Page #" text) nor console output
Current vs. Expected behavior
Expect getServerSideProps
to trigger when navigating back to Index page from within the app, and props passed into the page
Current Props are not being passed
Provide environment information
System:
OS: macOS 14.4.1
CPU: (10) arm64 Apple M1 Max
Memory: 279.94 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
Browsers:
Chrome: 124.0.6367.203
Safari: 17.4.1
npmPackages:
next: 14.2.3 => 14.2.3
react: ^18.2.0 => 18.2.0
Which area(s) are affected? (Select all that apply)
Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
App uses middleware.ts
file and basePath
in next.config
, when navigating from a page back to index route the request for pageProps (index.json) in the browser returns a 308 status (expected a 200), and the props from getServerSideProps are lost on page load.