Skip to content

Uncaught TypeError: startTransition is not a function #3557

@liby

Description

@liby
  • 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):

  1. Error: Cancel rendering route
  2. Uncaught (in promise) TypeError: startTransition is not a function
  3. Uncaught TypeError: startTransition is not a function
    image

To Reproduce

Steps to reproduce the behavior:

  1. Go to Demo
  2. Open DevTools
  3. Click on any of the post links, page does not navigate to the specified page
  4. See error
    image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions