Preact: Issues with Suspense/lazy in Preact 10.0.1

Created on 17 Oct 2019  路  4Comments  路  Source: preactjs/preact

I am using Parcel + TypeScript + Preact and when i upgraded from Preact version 10.0.0 to 10.0.1 I started to get an error with Suspense.

Uncaught (in promise) TypeError: Cannot read property 'indexOf' of null
    at t (suspense.js:64)

All that changed was the patch version of Preact. I have a repository showing the issue and my settings here: https://github.com/nrdobie/preact-10.0.1-issue. The master branch uses 10.0.0 and broken branch uses 10.0.1

Main Packages Versions:

Most helpful comment

Fix has been PR'ed, thanks for the reproduction this helped me to tackle the problem. It's a bit of a bad luck one to be fair. The thing is that it wasn't safe for _suspensions to exist without mangling this would mean that terser is safe to mangle it to whatever it wants which can interfere/be overwritten.

This has now been pinned to __u.

All 4 comments

Ran into the same issue but with Webpack + TS + Preact.

10.0.0 also works fine but updating to 10.0.1 breaks it as above.

Fix has been PR'ed, thanks for the reproduction this helped me to tackle the problem. It's a bit of a bad luck one to be fair. The thing is that it wasn't safe for _suspensions to exist without mangling this would mean that terser is safe to mangle it to whatever it wants which can interfere/be overwritten.

This has now been pinned to __u.

I still have this problem with version 10.0.5. I just checked it with version 10.0.0 and it worked with this version. But with all following version the problem still exists.

suspense.js:65 Uncaught (in promise) TypeError: t.__u.indexOf is not a function
    at e (suspense.js:65)

Hey,

The target is right in your issue @janbaer so we might need a reproduction for that one since it seems to work in simple cases. This might be a separate issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zashy picture Zashy  路  3Comments

jescalan picture jescalan  路  3Comments

jasongerbes picture jasongerbes  路  3Comments

k15a picture k15a  路  3Comments

KnisterPeter picture KnisterPeter  路  3Comments