-
-
Notifications
You must be signed in to change notification settings - Fork 2k
component._suspended is not a function, is true #3150
Description
- Check if updating to the latest Preact version resolves the issue
Describe the bug
A clear and concise description of what the bug is.
When triggering hmr with prefresh while using suspense & lazy the following error gets thrown:
(Note that you have to trigger the HMR from a different file that you main entry file)
suspense.js:235 Uncaught (in promise) TypeError: t.__e is not a function
at U (suspense.js:235)
at L.__c (suspense.js:124)
at Object.n.__e (suspense.js:18)
at I (index.js:255)
at m (children.js:137)
at I (index.js:198)
at m (children.js:137)
at I (index.js:198)
at m (children.js:137)
at I (index.js:198)
From what I can gather on suspense.js#L18 we check if the vnode is suspended, but and the check on suspense.jsL235# expects the parents _suspended property to be a function or false, but somewhere this _suspended property got rewritten to true. (How is this even possible?)
To Reproduce
The repro is more complicated since it involves prefresh but I'll try to create a minimal example tomorrow!
Steps to reproduce the behavior:
- Create an async function that returns an element
- Add a suspense + lazy that uses the async function
- Import the suspense + lazy component in a separate file and render the app from that file
- Cause a hmr refresh from the first file and see the error
Expected behavior
What should have happened when following the steps above?
No error