so far so good, everything renders properly on the server and the client.
Recently I've integrated react-map-gl (a mapbox-gl wrapper for react).
Of course, when importing the project, I get an error on the Window object since this package needs to be render on the client.
So I've used a dynamic import using ssr: false, ant it works in dev and production, great.
However, I've tried to see how google bot sees it (I use page speed insight instead of fetch and render as google), and I've notices the nextJS error message : 'an unexpected error has occured'.
After further investigations, I found out that, by removing _document.js (used to integrate aphrodite and material-ui), the map renders without error with google bot (showing only the dynamic import loading component).
So my questions are :
is _document.js logic only supposed to be used server side? How come a component not rendered on the server can be affected by it?
is it possible to catch this 'unexpected error' message in the now server logs? I've been debugging blindly and it's really difficult.
Hi all,
I have integrated material-ui and aphrodite in my current project, merging those two exemples https://github.com/mui-org/material-ui/tree/v1-beta/examples/nextjs https://github.com/zeit/next.js/tree/canary/examples/with-aphrodite
so far so good, everything renders properly on the server and the client.
Recently I've integrated react-map-gl (a mapbox-gl wrapper for react). Of course, when importing the project, I get an error on the Window object since this package needs to be render on the client. So I've used a dynamic import using ssr: false, ant it works in dev and production, great.
However, I've tried to see how google bot sees it (I use page speed insight instead of fetch and render as google), and I've notices the nextJS error message : 'an unexpected error has occured'.
After further investigations, I found out that, by removing _document.js (used to integrate aphrodite and material-ui), the map renders without error with google bot (showing only the dynamic import loading component).
So my questions are :
Thanks a lot.