Skip to content

Example application fails on web #16

@SevereOverfl0w

Description

@SevereOverfl0w

After pnpm start

It seems to be down to this code in src/js/Home.tsx

<NativeNavigationRouter navigation={nativeNavigationNavigatorOptions}>
<Routes>
</Routes>
</NativeNavigationRouter>

triggers these errors:

21:09:14.706 [vite] connecting... client:789:9
21:09:14.727 [vite] connected. client:912:15
21:09:14.791 Uncaught Error: useRoutes() may be used only in the context of a <Router> component.
    invariant history.ts:494
    useRoutesImpl hooks.tsx:355
    useRoutes hooks.tsx:345
    Routes components.tsx:515
    React 11
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    scheduler chunk-VB4GG4QC.js:405
    scheduler chunk-VB4GG4QC.js:453
    __require chunk-5WRI5ZAA.js:8
    scheduler chunk-VB4GG4QC.js:465
    __require chunk-5WRI5ZAA.js:8
    React 2
    __require chunk-5WRI5ZAA.js:8
    dom React
    __require chunk-5WRI5ZAA.js:8
    dom React
    __require chunk-5WRI5ZAA.js:8
    <anonymous> react-dom_client.js:38
react-router-dom.js:209:11
21:09:14.793 Uncaught Error: useRoutes() may be used only in the context of a <Router> component.
    invariant history.ts:494
    useRoutesImpl hooks.tsx:355
    useRoutes hooks.tsx:345
    Routes components.tsx:515
    React 12
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    scheduler chunk-VB4GG4QC.js:405
    scheduler chunk-VB4GG4QC.js:453
    __require chunk-5WRI5ZAA.js:8
    scheduler chunk-VB4GG4QC.js:465
    __require chunk-5WRI5ZAA.js:8
    React 2
    __require chunk-5WRI5ZAA.js:8
    dom React
    __require chunk-5WRI5ZAA.js:8
    dom React
    __require chunk-5WRI5ZAA.js:8
    <anonymous> react-dom_client.js:38
react-router-dom.js:209:11
21:09:14.793 The above error occurred in the <Routes> component:

Routes@http://localhost:5173/@fs/home/overfl0w/src/github.com/cactuslab/capacitor-native-navigation/packages/example/node_modules/.vite/deps/react-router-dom.js?v=cb086176:4561:7
NativeNavigationRouter@http://localhost:5173/@fs/home/overfl0w/src/github.com/cactuslab/capacitor-native-navigation/packages/react-router/dist/esm/NativeNavigationRouter.js:42:7
div
Home@http://localhost:5173/js/Home.tsx?t=1761077348605:29:45

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries. <anonymous code>:1:145535
21:09:14.794 Uncaught Error: useRoutes() may be used only in the context of a <Router> component.
    invariant history.ts:494
    useRoutesImpl hooks.tsx:355
    useRoutes hooks.tsx:345
    Routes components.tsx:515
    React 9
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    scheduler chunk-VB4GG4QC.js:405
    scheduler chunk-VB4GG4QC.js:453
    __require chunk-5WRI5ZAA.js:8
    scheduler chunk-VB4GG4QC.js:465
    __require chunk-5WRI5ZAA.js:8
    React 2
    __require chunk-5WRI5ZAA.js:8
    dom React
    __require chunk-5WRI5ZAA.js:8
    dom React
    __require chunk-5WRI5ZAA.js:8
    <anonymous> react-dom_client.js:38
react-router-dom.js:209:11

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