-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Uncaught TypeError: startTransition is not a function #3557
Description
- Check if updating to the latest Preact version resolves the issue
Describe the bug
This is a bug related to Preact with Next.js. When an exception is throw in the render phase of a clientside rendered page the Next.JS pages/_error fails to render.
Using the latest Preact@10.7.3 and Next.js@12.1.6 and React@18.1 installed, changing the route (e.g. calling Router.replace, Router.push) will throw three errors(Local development):
- Error: Cancel rendering route
- Uncaught (in promise) TypeError: startTransition is not a function
- Uncaught TypeError: startTransition is not a function

To Reproduce
Steps to reproduce the behavior:
- Go to Demo
- Open DevTools
- Click on any of the post links, page does not navigate to the specified page
- See error

Expected behavior
The page navigates to the specified link as expected.
Notes
What is the reason for having React 18 installed alongside Preact?
I use React while developing and only replace it with Preact in production.
The same as mentioned in #3233, even if I add pages/failing and pages/_error, when an exception is throw in the render phase of a client-side rendered page the Next.js pages/_error fails to render.
Possibly related: #3512, #3502, #3233, preactjs/next-plugin-preact#53