Skip to content

DefaultCatchBoundary Error: TypeError: Invalid URL #7476

@shivamklr

Description

@shivamklr

Which project does this relate to?

Router

Describe the bug

Unable to reach /users route from incognito tab or direct render (ctrl+r) at /users route.

DefaultCatchBoundary Error: TypeError: Invalid URL: /api/users
    at loader (/home/user/projects/start-basic-cloudflare/src/routes/users.tsx:6:23)
    at runLoader (/home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/load-matches.ts:669:28)
    at handleLoader (/home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/load-matches.ts:852:13)
    at loadRouteMatch (/home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/load-matches.ts:935:13)
    at loadMatches (/home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/load-matches.ts:1028:24)
    at /home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/router.ts:2434:17
    at RouterCore.startTransition (/home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/router.ts:1017:48)
    at /home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/router.ts:2415:12
    at new Promise (<anonymous>)
    at RouterCore.load (/home/user/projects/start-basic-cloudflare/node_modules/.pnpm/@tanstack+router-core@1.171.3/node_modules/@tanstack/router-core/src/router.ts:2414:19)

Complete minimal reproducer

https://github.com/TanStack/router/tree/main/examples/react/start-basic-cloudflare

Steps to Reproduce the Bug

  1. npx gitpick TanStack/router/tree/main/examples/react/start-basic-cloudflare start-basic-cloudflare
  2. npm i
  3. npm run dev
  4. Go to localhost:3000/users directly without visiting any other page. Or hard refresh at /user

Expected behavior

As a user, I expect the example to work by default. If this is a feature of the tanstack router, it should be mentioned in the readme of this example.

Screenshots or Videos

Image

Platform

  • Router / Start Version: same as example
  • OS: Linux
  • Browser: Mozilla Firefox 150.0.3
  • Browser Version: 150.0.3
  • Bundler: Same as example
  • Bundler Version: Same as example

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions