The work in #14740 has caused a bug when a page errors on the server side
Uncaught TypeError: Cannot read property 'statusCode' of undefined
at Object.fLxa (index.js:60)
at t (bootstrap:86)
at Object.LwBP (next.js:1)
at t (bootstrap:86)
at c (bootstrap:45)
at Array.a [as push] (bootstrap:32)
at 84f3b8c7222dd2225c268a644154c5ba8e99769e.f6885231c259f16e58e7.js:1
Inspecting the error it's happening with:
if (
page !== '/404' &&
!(
page === '/_error' &&
hydrateProps &&
hydrateProps.pageProps.statusCode === '404'
)
) {
asPath = delBasePath(asPath)
}
Namely hydrateProps does not have a pageProps at this moment. All it has is initialProps, initialState and isServer
pageProps should be prefixed with initialProps
EG the full line should be
hydrateProps.initialProps.pageProps.statusCode === '404'
Generate an error server side.
function App() {
const [s, setS] = useState({});
const z = useMemo(
() => ({
a: s.g.h, //.h is not defined
}),
[s.g.h]
);
Should not throw an exception here

Can you please try this on next@canary?
@Timer Thanks Joe! I was just about to submit a PR and then I noticed that #15760 resolves this (I think)
Im going to go to canary and see. I'll close this if so.
@Timer totally fixed it! Thank you!
Most helpful comment
@Timer totally fixed it! Thank you!