TanStack / TanStack/router

DefaultCatchBoundary Error: TypeError: Invalid URL

Open Beginner friendly
#7,476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

examples
Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/routes/users.tsx, especially the loader at line 6, then reproduce the issue in the start-basic-cloudflare example with the listed npm commands. Verify direct navigation or a hard refresh at /users succeeds without the Invalid URL error; if the behavior is intentional, document the requirement in that example's README.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
full-stack, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.