Description
Summary
With version 13.3.0"
State is not preserved between App routes with NextJs runtime.
When setting state with context and navigation to a new app route the context state is then reset when loading the new route. (see console for the state)
Deployment here: https://deploy-preview-1--luminous-stroopwafel-f13ec5.netlify.app/
Repo to reproduce is here: https://github.com/bentrynning/next-app-test
Also tried to bump to the latest version 13.3.3
But then app is not loading at all.
Deployment here: https://luminous-stroopwafel-f13ec5.netlify.app/
All works well locally and also when hosted on Vercel.com
https://next-app-test-mu.vercel.app/
Steps to reproduce
- Fork https://github.com/bentrynning/next-app-test
- Install on netlify using @netlify/[email protected] (this is default) when setting up a new project
A link to a reproduction repository
https://github.com/bentrynning/next-app-test
Next Runtime version
4.36.0
Is your issue related to the app
directory (beta)?
- Yes, I am using the
app
directory
More information about your build
- I am building using the CLI
- I am building using file-based configuration (
netlify.toml
)
What OS are you using?
Mac
Your netlify.toml file
No response
Your public/_redirects file
No response
Your next.config.js
file
`next.config.js`
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
pageExtensions: ['ts', 'tsx', 'js', 'jsx'],
}
module.exports = nextConfig
Function logs
Function logs
With NextJs 13.3.3 SSR function
ay 1, 12:57:15 PM: 48c6bf10 ERROR TypeError: Cannot set properties of undefined (setting 'current')
at ue (/var/task/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:42)
at /var/task/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:151:127
at new Promise (<anonymous>)
at Object.exports.renderToReadableStream (/var/task/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:151:53)
at /var/task/node_modules/next/dist/server/node-web-streams-helper.js:195:117
at NextTracerImpl.trace (/var/task/node_modules/next/dist/server/lib/trace/tracer.js:86:20)
at renderToInitialStream (/var/task/node_modules/next/dist/server/node-web-streams-helper.js:195:37)
at /var/task/node_modules/next/dist/server/app-render/app-render.js:937:92
at processTicksAndRejections (node:internal/process/task_queues:96:5)