Open siloor opened 1 year ago
The issue is not environment dependant.
App directory (appDir: true)
https://github.com/vercel/next.js/blob/canary/packages/next/src/client/index.tsx#L442
-
This
return Promise.resolve( renderErrorProps.props?.err ? renderErrorProps.props : loadGetInitialProps(App, appCtx)
Should be
return Promise.resolve( renderErrorProps.err ? renderErrorProps.props : loadGetInitialProps(App, appCtx)
As err is stored not on renderErrorProps.props, just renderErrorProps.
err
renderErrorProps.props
renderErrorProps
Like this, a server error always calls App.getInitialProps on the client side.
App.getInitialProps
In case of a server error, next should not call App.getInitialProps on the client side.
next
No response
Can I make this code change? I want to make my first contribution. I am new to open source. Sorry if I said something wrong.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/vercel/next.js/blob/canary/packages/next/src/client/index.tsx#L442
To Reproduce
-
Describe the Bug
This
Should be
As
err
is stored not onrenderErrorProps.props
, justrenderErrorProps
.Like this, a server error always calls
App.getInitialProps
on the client side.Expected Behavior
In case of a server error,
next
should not callApp.getInitialProps
on the client side.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response