You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading content from a CMS in getInitialProps we seem to be getting some erratic errors with server side rendering that imply the data was never returned despite using async/await on our calls to the CMS and returning the data. These errors don't seem to stop the site from rendering
TypeError: Cannot read property 'fullTitle' of undefined
at Default (/website/.next/dist/layouts/Default.js:53:174)
at ReactCompositeComponentWrapper._constructComponentWithoutOwner (/website/node_modules/react-dom/lib/ReactCompositeComponent.j
s:309:14)
at ReactCompositeComponentWrapper._constructComponent (/website/node_modules/react-dom/lib/ReactCompositeComponent.js:285:19)
at ReactCompositeComponentWrapper.mountComponent (/website/node_modules/react-dom/lib/ReactCompositeComponent.js:188:21)
at Object.mountComponent (/website/node_modules/react-dom/lib/ReactReconciler.js:46:35)
at ReactCompositeComponentWrapper.performInitialMount (/website/node_modules/react-dom/lib/ReactCompositeComponent.js:371:34)
at ReactCompositeComponentWrapper.mountComponent (/website/node_modules/react-dom/lib/ReactCompositeComponent.js:258:21)
at Object.mountComponent (/website/node_modules/react-dom/lib/ReactReconciler.js:46:35)
at ReactCompositeComponentWrapper.performInitialMount (/website/node_modules/react-dom/lib/ReactCompositeComponent.js:371:34)
at ReactCompositeComponentWrapper.mountComponent (/website/node_modules/react-dom/lib/ReactCompositeComponent.js:258:21)
In this case fullTitle is a property that a class is expecting to be in the return from getInitialProps.
There are some other issues (#827) that were opened that dealt with this by returning an empty object from getInitialProps if the CMS return any data but that results in errors further down the line of the render chain for us as the properties that are expected to be in the getInitialProps return do not exist.
The errors are inconsistent enough that I'm not sure how to recreate them without changing code enough to break rendering all together. Does anyone have any recommendations on how to tackle this or approach debugging this?
The text was updated successfully, but these errors were encountered:
So it seems like your fetch request doesn't send data always or something like this.
And make sure, we only support getInitialProps in the page component only.
You must return an object from getInitialProps and now we show a nice error if not.
Also run the latest release of Next.js.
Unfortunately, without a way to re-produce, we can't really help you.
Feel free to re-open when you have a way to isolate the issue.
When loading content from a CMS in getInitialProps we seem to be getting some erratic errors with server side rendering that imply the data was never returned despite using async/await on our calls to the CMS and returning the data. These errors don't seem to stop the site from rendering
In this case fullTitle is a property that a class is expecting to be in the return from getInitialProps.
There are some other issues (#827) that were opened that dealt with this by returning an empty object from getInitialProps if the CMS return any data but that results in errors further down the line of the render chain for us as the properties that are expected to be in the getInitialProps return do not exist.
The errors are inconsistent enough that I'm not sure how to recreate them without changing code enough to break rendering all together. Does anyone have any recommendations on how to tackle this or approach debugging this?
The text was updated successfully, but these errors were encountered: