-
-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window is not defined (ssr) #1291
Comments
Thanks for this, the child code checks for I will hopefully get a beta out with a number of things in it later today. |
Could you please try version |
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.
Hopefully it works for you this time. |
Make that I need to come up with an SSR test, as everything is currently configures for Client Side and auto mocks |
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. |
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
![Capture d’écran 2024-07-11 à 08 48 45](https://private-user-images.githubusercontent.com/1873323/347710373-7862e2fc-7011-422f-b8bb-0181443fa5a5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMjc2NzUsIm5iZiI6MTcyNDEyNzM3NSwicGF0aCI6Ii8xODczMzIzLzM0NzcxMDM3My03ODYyZTJmYy03MDExLTQyMmYtYjhiYi0wMTgxNDQzZmE1YTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjBUMDQxNjE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTg0MmQ4NWMzNzE0OTNhOTFmMmRkMzc0Y2JhN2UyOWE0OWI2NTQ2MzBkYmZmZWRjZjA1MGNiZTM1NWU1YzYxNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.1UsUw2qdZP0G1HfPsm95ZtQIfrOK412iEFjnsNIg2g8)
Desktop
The text was updated successfully, but these errors were encountered: