-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static Exported Dynamic Page is re-mounted (getInitialProps called twice) #9902
Comments
Thanks for the swift response. Is there an estimate with 9.2 will be available ? |
I've released it on |
Thanks. I can confirm that getInitialProps is no longer called. However, for dynamic pages (statically exported), the component is rendered, re-mounted and rendered again. A 'regular' page component is only rendered once. Is this an issue or just part of the life cycle of a dynamic page ? |
It's just part of the life cycle right now, as the page is letting you know the router has provided any user-input if present. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
For a static export, dynamic pages have an issue where the component is rendered, then re-mounted, getInitialProps called, and re-rendered. This causes a problem if getInitialProps attempts to do server side things (e.g. read from file system).
Describe the bug
next.config.js has an exported Path Map (e.g ...
For the Dynamic Pages (e.g. /weekly/[id] ) the page is rendered fine but then the component is re-mounted and getInitialProps is called again. This behavior doe NOT exist for the static pages (e.g /schedule)
To Reproduce
Expected behavior
the dynamic page component with the properly exported path map should behave the same as the simple component w.r.t getInitialProps NOT being called in the client.
Also, these pages are NOT navigated via Link component.
Screenshots
console of the dynamic component being served on a single request
System information
The text was updated successfully, but these errors were encountered: