Skip to content
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

Cannot set properties of null (setting '__h') error when suspending the entire app #3642

Closed
theninthsky opened this issue Aug 2, 2022 · 2 comments · Fixed by #3643
Closed

Comments

@theninthsky
Copy link

theninthsky commented Aug 2, 2022

Preact version: 10.10.0 (happens in earlier versions aswell).

Bug Description

When wrapping the entire <App> with Suspense, I get the following error:

Uncaught TypeError: Cannot set properties of null (setting '__h')
    at M

And the app breaks after navigating to another page (it becomes unresponsive).

This does not happen if I only wrap the <Routes> component with Suspense.

To Reproduce

  1. Clone my repo: https://github.com/theninthsky/client-side-rendering/tree/preact.
  2. Execute npm i and npm start.
  3. Refresh the page a few times until this error shows (it's inconsistent, as if it depends on script loading times or something).

You can even visit the preview deploy here: https://70f42741.client-side-rendering.pages.dev

Expected behavior
No error should be thrown and the app should be responsive.

I'd like to add that I really love Preact and its great compatibility with React codebase, and that the ability to suspend the entire app is very important to me (in order to prevent when I call Sequenced Rendering).

@theninthsky
Copy link
Author

@JoviDeCroock
Thanks for the very quick fix!
However, I now get another error, will be opening a new issue soon.

@JoviDeCroock
Copy link
Member

Heh, I even thought about you when making #3645 but then completely forgot to guard for that

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 a pull request may close this issue.

2 participants