vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.71k stars 26.84k forks source link

cross-domain iframe not hydrating after SSR on devServer #18028

Open gutofoletto opened 3 years ago

gutofoletto commented 3 years ago

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.

This behaviour was observed when upgrading from 9.2.0 to 9.2.1 (or greater)

To Reproduce

  1. Clone this repository (there are some instructions on the readme file as well)
  2. Set up your /etc/hosts file and point the domain to your localhost: 127.0.0.1 yourcustomdomain.dev.com
  3. Go to the root folder and run nextJS devServer with yarn dev
  4. Go to the public folder and serve index.html, you could use php local server if you want: php -S 0.0.00:8080
  5. Open the browser and go to http://localhost:8080
  6. Open the browser console and observe the logs
  7. Only the iframe init log will be present and none of the logs from the HomePage will be displayed
  8. 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?

Screenshots

ezgif com-gif-maker

System information

ealvarez968 commented 3 years ago

Hi, can I take a look at this?

OriginalJef commented 2 years ago

Any updates on this one?

danwdart commented 2 years ago

This is still reproducible on 12.1.0