Closed dackmin closed 1 month ago
Thanks for this, the child code checks for window
and halts if it is not there. However, their where a couple of variables getting setup before that point that had references to window
in them, that I now also guard. This was not an issue in v4 due to the build process being different and allowing me to check for window
and exit before defining anything. But sadly that is not possible with Rollup.
I will hopefully get a beta out with a number of things in it later today.
Could you please try version 5.2.0-beta.3
and let me know if that fixes this for you?
almost there 😄
here's a codesandbox to see the bug in action: https://codesandbox.io/p/devbox/iframe-resizer-ssr-issue-dr8r95
OK different and more robust approach. I've wrap the whole thing in a function, that only gets called if window is available.
5.2.0-beta.4
Hopefully it works for you this time.
Make that 5.2.0-beta.5
.
I need to come up with an SSR test, as everything is currently configures for Client Side and auto mocks window
and document
.
Works perfectly inside codesandbox, I can't work on the original project right now but that's the exact same configuration so it should work too. Well done!
Thanks for letting me know. Just putting the finishing touches to rewriting the performance observer code and then will push out the final release of 5.2.
Released in v5.2
Describe the bug v5 is using
window
inside@iframe-resizer/child
which breaks server-side rendering.To Reproduce Load a child from something like Next (that has server side rendering)
Expected behavior v4 doesn't and works perfectly.
Screenshots
Desktop