-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Timing bug with Suspense render results in TypeError: Cannot set property '0' of null.
#2488
Comments
same here, i'm using lazy route in my app too. i output some debug message via console and i found out this error message was threw by preact compat, when it is loading lazy route. but i can't find where the bug is exactly. |
according to #2519 , i downgrade preact to 10.0.5 and this bug is gone. |
It is broken on version 10.5.7, suspense works on version 10.4.6 |
@VitaliiPyvovar what is broken? Can you file a new issue for that? We'd love to take a look at it, but we need more information than "something is broken". |
Suspense causes following error on preact 10.5.12: While on latest 16.x react, everything works fine. I used webpack aliases from docs. This happens when I focus into this component in project running on create-react-app+craco+typescript. |
@iMakedonsky I fixed after lazy loading the module encapsulated within the Suspense. Have you tried that? |
@rdalmas there were a couple of issues with suspense.
|
@iMakedonsky You saved me hours of debugging with the #2. Thanks! |
Hi, is it likely that there'll be any progress on this? Am currently reverting to I can see there was a PR but this was closed? #3128 |
This shouldn't be closed (or maybe a new issue should be made) because as of |
This issue still exists in |
@marvinhagemeister This is the repo: https://github.com/theninthsky/client-side-rendering/tree/preact You can even try the preview deploy here: https://6c71c4b6.client-side-rendering.pages.dev Try moving between pages and refreshing until this error is encountered (it's inconsistent). |
The app crash I'm seeing originates from here and surfaced as
TypeError: Cannot set property '0' of null.
This was discovered during an application reworking to use
preact
rather thanreact
. The bug does not repro withreact
.Reproduction
CodeSandbox available here
Minimal repo showing the issue is available here
Steps to reproduce
Force a re-render of a component hosting the
<Suspense />
element before the initial fallback has rendered. In the minimal repro and my case, this was happening because something was being calculated and put into state duringcomponentDidMount
.Suspense
thinks it needs to render the fallback and detach thelazy
component, however, because of the external re-render, there are no children in thevnode
Expected Behavior
Either the
lazy
is rerun, or the fallback is rendered.Actual Behavior
The app crashes with
TypeError: Cannot set property '0' of null.
The text was updated successfully, but these errors were encountered: