suspense fix: Cannot read property 'insertBefore' of undefined #4141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please see #3149 & #3105 for context.
Migrating from React to Preact, our suspense boundaries are failing everywhere with this problem still on latest Preact.
Looking into those specific issues and not finding a solution that worked, I delved into the
suspense.js
file and played around. The only solution I could find was adding a check fororiginalParent
at the top level ofremoveOriginal()
.I've created a test from the repro in #3149, their way was the only way i could find to simply reproduce.
The change to
suspense.js
fixes the test.I'm currently patching preact dist code with this change to make our app work, if this change is wrong and can't be merged, any way of getting round the problem would be greatly appreciated, it's the only thing I've found to work!