Broken SSR
Closed this issue · 4 comments
nickensoul commented
Thanks for this component at first!
import 'intersection-observer';
breaks down SSR due it uses window object without checking for available inside of it.
Please, can you remove this import and warn this in Readme instead?
Checked at Gatsby 2 at build command.
Thanks!
AvraamMavridis commented
We need the polyfill though, we need to find a way to achieve both.
Gregoor commented
What's the polyfill needed for? Afaik create-react-app transpiles node_modules since V2.
AvraamMavridis commented
@Gregoor sorry I dont get it, why create-react-app
is related? The polyfill is needed for browsers that do not implement the IntersectionObserver API.
AvraamMavridis commented
@Gregoor @nickensoul in any case I will remove the import