DefaultCatchBoundary Error: TypeError: Invalid URL
Nobody has claimed this yet.
- 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
- npx gitpick TanStack/router/tree/main/examples/react/start-basic-cloudflare start-basic-cloudflare
- npm i
- npm run dev
- Go to
localhost:3000/usersdirectly 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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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