It seems that when the app is loaded on a cross-domain iFrame nextJS (dev server) does not hydrate SSR pages / components unless they are visible on the screen.
If you run the same project on a "same-domain" website it works as expected.
If you remove visibility: hidden or display:none it works on both "cross and same domain" environment.
This behaviour was observed when upgrading from 9.2.0 to 9.2.1 (or greater)
To Reproduce
Clone this repository (there are some instructions on the readme file as well)
Set up your /etc/hosts file and point the domain to your localhost: 127.0.0.1 yourcustomdomain.dev.com
Go to the root folder and run nextJS devServer with yarn dev
Go to the public folder and serve index.html, you could use php local server if you want: php -S 0.0.00:8080
Open the browser and go to http://localhost:8080
Open the browser console and observe the logs
Only the iframe init log will be present and none of the logs from the HomePage will be displayed
The logs from HomePage will be triggered if you press "show" to display the component (removes the visibility: hidden css property)
Expected behavior
It is expected that when using the development server it would hydrate / rerender the components on a cross-domain iframe. Is that right?
Bug report
Describe the bug
It seems that when the app is loaded on a cross-domain iFrame nextJS (dev server) does not hydrate SSR pages / components unless they are visible on the screen.
visibility: hidden
ordisplay:none
it works on both "cross and same domain" environment.This behaviour was observed when upgrading from 9.2.0 to 9.2.1 (or greater)
To Reproduce
/etc/hosts
file and point the domain to your localhost:127.0.0.1 yourcustomdomain.dev.com
root
folder and run nextJS devServer withyarn dev
public
folder and serveindex.html
, you could use php local server if you want:php -S 0.0.00:8080
http://localhost:8080
iframe init
log will be present and none of the logs from theHomePage
will be displayedHomePage
will be triggered if you press "show" to display the component (removes thevisibility: hidden
css property)Expected behavior
It is expected that when using the development server it would hydrate / rerender the components on a cross-domain iframe. Is that right?
Screenshots
System information