-
Notifications
You must be signed in to change notification settings - Fork 150
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
Defer not working inside iframe #694
Comments
Hey, thanks for raising this. We believe this is a consequence of how cloudflare tunnels (which the CLI uses by default for development) work. They seem to buffer the deferred response and return a single chunk, which seems to "break" the We've added some documentation to the template to help work around this issue. Please let us know if that solves it! |
Hi thanks for looking into this - I'm aware of the cloudflare issue as stated at the bottom of my issue report. However the issues does also occur using ngrok but seems clearly related to the iFrame since it is working fine outside the iFrame. |
Oh sorry, I failed to see you mentioned that. I'll start tracking this issue and we'll look into it. FWIW I tried running your code and I saw the symptom you reported, but I also got a hydration error around the use of |
Hi, thank you for looking into this. |
@paulomarg Is there anything else you need from my side? I see the issue marked as "waiting for response" |
Hey, sorry for the delayed response. I'll remove that label. I've added it to our backlog, so no other action needed now! |
@paulomarg Is there any ETA on this? I'm having a couple of feature on the roadmap that rely on this |
We have some other things that will take precedence here so I can't give any dates, but this is in our immediate list of items to investigate! |
Hi, we've investigated this issue and it doesn't seem to be anything that the app itself is doing - I was able to reproduce your scenario with the code you provided (thanks!), and if I load that within an iframe outside of the Shopify admin, deferring works. That points to there being an issue in the admin itself and how it's loading the app. I've forwarded this to the team that manages that part of the code, and they're going to look into it. However, this is probably not an easy fix, so it might take a while to resolve. In the meantime, I would suggest not using deferred requests in your app so it doesn't affect your performance metrics. I'll keep you posted if I hear anything back from them! Thanks again for raising this issue. |
@paulomarg Any feedback about this question? |
I can confirm this was fixed. Using it in production - works perfectly |
@alexanderhupfer Do I need to update any packages? My app still doesn't work as expected, defer does work but it seems like the client always waits for everything to load before starting to render, so I never see the fallback being rendered. |
Same problem here. |
I just checked, still works. This are my package versions. I'm not using single-fetch on remix side
|
Issue summary
Before opening this issue, I have:
@shopify
packagesv21.7.3
- Operating system: MacOS{ logger: { level: LogSeverity.Debug } }
in my configurationdefer
is not working inside the iFrame / embedded app. However it works outside the iFrame,Expected behavior
Page should render immediately, then the deferre content should appear once the promise has resoled.
Actual behavior
Page does not render until promise has resolved when inside iFrame
Steps to reproduce the problem
The browser log reports no hydration errors
Please not that there is a related issue to cloudflared due to which defer won't work with cloudflare tunnels: cloudflare/cloudflared#1095
Hence I used ngrok for testing, for which defer works as expected, just not inside the admin iFrame.
The text was updated successfully, but these errors were encountered: