Closed fev4 closed 5 years ago
What is the version of Next.js you are using?
@jaydenseric these are the related deps
"cross-fetch": "^3.0.0",
"graphql-react": "^6.0.0",
"next": "^7.0.2",
"next-graphql-react": "^1.0.1",
"react": "16.7.0",
"react-dom": "16.7.0",
"styled-components": "^4.1.3",
"styled-normalize": "^8.0.4",
Thanks for answering btw!
I've managed to reproduce the issue, and am trying to work out if it's a styled-components
or graphql-react
bug.
So it was kinda both.
I have made a styled-components
PR to make the GlobalStyleComponent
created by createGlobalStyle
call the base constructor with props
, which is a React class component best practice.
Since a lot of React SSR libraries are fault-tolerant of this, I will look at making the graphql-react
preload
function account for the situation too.
Also, I have some ideas how to make how preload
render errors display better, and not crash SSR.
This looks awesome. Thank you @jaydenseric !
graphql-react@6.0.1
and next-graphql-react@1.0.2
have been published, fixing all these issues 🙏
Hello,
Just today I found this behavior and would like to start a discussion in order to get to the bottom of it, because really, I'm not sure how to fix it.
This is the error:
It seems like a conflict between
preload
andcreateGlobalStyles
(fromstyled-components
). This is the implementation of global styles, it goes according to their docs:It's simply the implementation of base font sizes and resets from
styled-normalize
and just a bit of my own.This is the
_app.js
implementation on the side of Next.js. Comes directly from the examplewith-graphql-react
and trying to implement the global styles :Everything works whenever I comment out
<WGlobalStyles />
. Not sure how to pin point the unhandled promise in this case.If there's any other info I can provide in order to help solve this, please let me know.
Cheers