Skip to content

Race condition in router #1880

@Master-Hash

Description

@Master-Hash

repro:

  1. cd examples/03_demo/ && pnpm dev
  2. select a <Link> in F12 and const a = $0;
  3. select another and const b = $0;
  4. a.click(); b.click();
  5. Error:
Uncaught Error: There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.
    React 5
    performWorkUntilDeadline scheduler.development.js:45
Caused by: Error: Invalid element: route:/charmeleon
    Slot client.tsx:361
    React 10
    performWorkUntilDeadline scheduler.development.js:45
2 [react-dom-client.development.js:9634:9](http://localhost:3000/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.development.js)
Uncaught (in promise) TypeError: can't access property 0, refetching.current is null
    changeRoute client.tsx:875
    startTransitionFn client.tsx:317
    changeRoute client.tsx:870
    internalOnClick client.tsx:353
    startTransitionFn client.tsx:317
    internalOnClick client.tsx:349
    onClick client.tsx:379
    React 8
    <anonymous> debugger eval code:1
[client.tsx:875:9](http://localhost:3000/@fs/home/hash/workdir/waku/packages/waku/src/router/client.tsx)
    internalOnClick client.tsx:353
    AsyncFunctionThrow self-hosted:804
    (异步:async)
    startTransitionFn client.tsx:317
    internalOnClick client.tsx:349
    onClick client.tsx:379
    React 8
    <anonymous> debugger eval code:1
    getEvalResult eval-with-debugger.js:306
    evalWithDebugger eval-with-debugger.js:218
    evaluateJS webconsole.js:894
    evaluateJSAsync webconsole.js:787
    makeInfallible ThreadSafeDevToolsUtils.js:103

Metadata

Metadata

Assignees

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