Closed robdodson closed 4 years ago
Tests actually seem to be passing ok, it's just sauce labs failing to connect to Edge or Safari properly. Might be time to consider dropping Sauce in favor of GH Actions.
@robdodson FWIW, your changes look like they will fix the issue in SSR.
I believe the original issue that drew me here was that somebody was trying to use nuka-carousel
in Gatsby, and it was failing. Perhaps when I have some spare time, I will try to recreate the issue, and make sure your changes fix it. I can't guarantee when that will happen though; I've got a lot going on.
Maybe it would be worth it to use renderToString()
from react-dom/server
in a unit test, to see if it fails in SSR? Matter of fact, it should be the same thing if you just did a require()
directly from node... that's basically what's going to happen with this particular package in renderToString()
anyway.
Seems to work in my environment. No more 'Element is not defined' error.
Wraps the polyfill in an iife that first checks to see if
window
is defined before proceeding.