Skip to content

Conversation

sidhu663
Copy link

@sidhu663 sidhu663 commented Jul 29, 2025

Summary

Currently, when using lazy in combination with SSR (ChunkExtractor on the server side and loadableReady on the client), hydration does not reliably succeed despite the chunks being ready.

This is caused by the suspense branch suspending despite having the module ready and not being in a loading state. By using the existing result when state is not loading, we can avoid suspending and hydrate reliably without mismatches.

The existing logic does not work because there is no cachedPromise if preloaded via loadableReady

Test plan

Added two tests that replicate the babel transformed output when using the plugin.

There are lint failures on files unrelated to this PR that exist on main

@sidhu663 sidhu663 force-pushed the fix-needless-suspending-when-preloaded branch from 2cefe4d to 2b1dcd0 Compare July 29, 2025 20:55
@sidhu663
Copy link
Author

sidhu663 commented Aug 6, 2025

@theKashey @gregberge Any interest in this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant