Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Nov 12, 2025

Summary by CodeRabbit

  • New Features

    • Added a complete monorepo example for Solid Router with feature libraries, demonstrating type-safe routing across packages with route loaders, error handling, and nested routing patterns.
  • Documentation

    • Added comprehensive README with setup instructions and package structure explanation.
    • Updated navigation documentation to include the new example entry.

@github-actions github-actions bot added the documentation Everything documentation related label Nov 12, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Walkthrough

Adds a complete Solid.js monorepo example demonstrating TanStack router with three packages: a router library with file-based routes and type augmentations, a post-feature UI library, and a main app. Includes build configuration, loaders for data fetching, and documentation on type-safe cross-package linking.

Changes

Cohort / File(s) Summary
Documentation & Configuration
docs/router/config.json
Registers new Solid monorepo example entry in framework documentation index
Monorepo Root Setup
.gitignore, .stackblitzrc, pnpm-workspace.yaml.example, .vscode/settings.json, README.md, package.json
Configures monorepo-wide build scripts, StackBlitz environment, workspace layout, linting exclusions, and development documentation
App Package
packages/app/index.html, packages/app/package.json, packages/app/tsconfig.json, packages/app/vite.config.ts, packages/app/src/main.tsx, packages/app/src/rootComponent.tsx, packages/app/src/style.css
Establishes main application with Vite/Solid.js build, root navigation component, route mapping, styling, and TypeScript configuration
Post-Feature Package
packages/post-feature/package.json, packages/post-feature/tsconfig.json, packages/post-feature/vite.config.ts, packages/post-feature/src/index.ts, packages/post-feature/src/PostIdPage.tsx, packages/post-feature/src/PostList.tsx, packages/post-feature/src/PostError.tsx
Creates reusable feature library with post list/detail pages, error handling, and barrel exports; configured as library build target
Router Package
packages/router/package.json, packages/router/tsconfig.json, packages/router/vite.config.ts, packages/router/src/index.ts, packages/router/src/router.tsx, packages/router/src/routeTree.gen.ts, packages/router/src/routes/, packages/router/src/fetch/posts.ts
Core router library with file-based routes, generated route tree, type augmentations for TanStack router, loader utilities, and data-fetching layer (posts API, error types)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring attention:

  • Module augmentation pattern (packages/router/src/index.ts): Verify the @tanstack/solid-router Register interface is correctly wired for type safety across packages
  • Generated routeTree (packages/router/src/routeTree.gen.ts): Confirm file-based route resolution, type interface definitions, and rollup/build consistency
  • Cross-package type linkage: Review that PostNotFoundError, ErrorComponentProps, and router types flow correctly from router → post-feature → app without circular dependencies
  • Package.json workspace references: Validate monorepo dependency graph and entry points (dist paths, main/types exports)
  • Build configuration consistency: Ensure Vite configs across three packages align on externals, plugins, and output targets

Possibly related PRs

  • PR #5850: Both PRs add very similar Solid monorepo router examples with overlapping file structures (routeTree.gen.ts, router.tsx, package layouts, and fetch utilities)
  • PR #5831: Both PRs introduce Solid file-based router examples with identical module augmentation patterns and shared PostType/PostNotFoundError/fetchPost exports
  • PR #5836: Both PRs add new Solid framework example entries to docs/router/config.json, registering example visibility in documentation

Suggested reviewers

  • birkskyum
  • brenelz

Poem

🐰 A monorepo hops in three neat bounds,
Router, feature, app—all safely sound!
Types dance across the package line,
Loaders fetch and routes align.
File-based routes in Solid's grace,
No circles here—just type-safe space! 🌟

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(solid-router): router-monorepo-simple example' accurately describes the main change: adding a new Solid Router monorepo example with documentation and configuration files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs(solid-router)--router-monorepo-simple-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Nov 12, 2025

View your CI Pipeline Execution ↗ for commit 349c67b

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-12 23:46:46 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 12, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5852

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5852

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5852

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5852

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5852

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5852

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5852

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5852

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5852

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5852

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5852

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5852

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5852

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5852

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5852

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5852

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5852

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5852

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5852

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5852

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5852

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5852

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5852

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5852

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5852

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5852

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5852

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5852

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5852

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5852

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5852

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5852

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5852

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5852

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5852

commit: 349c67b

@birkskyum birkskyum merged commit 1cc3801 into main Nov 12, 2025
5 of 6 checks passed
@birkskyum birkskyum deleted the docs(solid-router)--router-monorepo-simple-example branch November 12, 2025 23:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 606dd19 and 349c67b.

⛔ Files ignored due to path filters (2)
  • examples/solid/router-monorepo-simple/assets/graph.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (31)
  • docs/router/config.json (1 hunks)
  • examples/solid/router-monorepo-simple/.gitignore (1 hunks)
  • examples/solid/router-monorepo-simple/.stackblitzrc (1 hunks)
  • examples/solid/router-monorepo-simple/.vscode/settings.json (1 hunks)
  • examples/solid/router-monorepo-simple/README.md (1 hunks)
  • examples/solid/router-monorepo-simple/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/index.html (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/src/style.css (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/app/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
examples/{react,solid}/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep example applications under examples/react/ and examples/solid/

Files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/app/src/style.css
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/app/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/app/index.html
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace:* protocol for internal dependencies in package.json files

Files:

  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/app/package.json
docs/{router,start}/**

📄 CodeRabbit inference engine (AGENTS.md)

Place router docs under docs/router/ and start framework docs under docs/start/

Files:

  • docs/router/config.json
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to docs/{router,start}/** : Place router docs under docs/router/ and start framework docs under docs/start/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/.stackblitzrc
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/app/src/style.css
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/.stackblitzrc
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

Applied to files:

  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.

Applied to files:

  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/src/routes/** : Place file-based routes under src/routes/ directories

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/.stackblitzrc
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/

Applied to files:

  • examples/solid/router-monorepo-simple/.stackblitzrc
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to docs/{router,start}/** : Place router docs under docs/router/ and start framework docs under docs/start/

Applied to files:

  • docs/router/config.json
  • examples/solid/router-monorepo-simple/README.md
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/

Applied to files:

  • docs/router/config.json
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-plugin/** : Use unplugin for universal bundler plugins in the router-plugin package

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/package.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/package.json : Use workspace:* protocol for internal dependencies in package.json files

Applied to files:

  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{*-start,start-*}/** : Name and place Start framework packages under packages/*-start/ or packages/start-*/

Applied to files:

  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
🧬 Code graph analysis (14)
examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (3)
examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (1)
  • Route (4-6)
examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)
  • Link (20-20)
examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (3)
examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (1)
  • Route (4-6)
examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (1)
  • Route (3-12)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
  • fetchPosts (27-33)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (2)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (3)
  • getRouteApi (24-24)
  • Link (20-20)
  • Outlet (19-19)
examples/react/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1)
  • PostsListComponent (5-34)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (2)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (3)
  • ErrorComponentProps (27-27)
  • PostNotFoundError (14-14)
  • ErrorComponent (25-25)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
  • PostNotFoundError (9-9)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)
  • PostNotFoundError (14-14)
examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (1)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (2)
  • Link (20-20)
  • Outlet (19-19)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (4)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)
  • getRouteApi (24-24)
examples/react/router-monorepo-simple-lazy/packages/post-feature/src/PostIdPage.tsx (1)
  • PostIdComponent (7-16)
examples/react/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1)
  • PostIdComponent (5-14)
e2e/react-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
  • PostComponent (19-28)
examples/solid/router-monorepo-simple/packages/router/src/router.tsx (1)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (3)
  • router (12-12)
  • RouterType (3-3)
  • RouterIds (3-3)
examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (2)
examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
  • fetchPost (11-25)
examples/solid/router-monorepo-simple/packages/router/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-simple/packages/app/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)
examples/solid/router-monorepo-simple/packages/router/src/router.tsx (1)
  • router (7-13)
examples/solid/router-monorepo-simple/packages/app/src/main.tsx (5)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1)
  • PostsListComponent (5-34)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1)
  • PostIdComponent (5-14)
examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (1)
  • RootComponent (4-23)
examples/solid/router-monorepo-simple/packages/router/src/router.tsx (2)
  • RouterIds (16-16)
  • router (7-13)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (1)
  • PostErrorComponent (7-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Preview
🔇 Additional comments (29)
examples/solid/router-monorepo-simple/.gitignore (2)

6-6: The .gitignore is correctly configured for this monorepo example.

The *.js pattern is appropriate—the project uses TypeScript exclusively for configs (vite.config.ts, tsconfig.json), so this pattern exists to ignore compiled JavaScript output, not intentional config files. The pnpm-workspace.yaml pattern is also correct: the example commits pnpm-workspace.yaml.example, and the .gitignore properly ignores the runtime pnpm-workspace.yaml file that users will create locally by copying the example. This is standard practice for example projects and does not defeat their purpose.

Likely an incorrect or invalid review comment.


13-13: Update README.md to document the pnpm-workspace.yaml setup.

The example provides pnpm-workspace.yaml.example as a template but the README doesn't explain this. Users should be informed that:

  • If running this example within the main monorepo, the root pnpm-workspace.yaml is used automatically
  • If running the example in isolation, they must rename pnpm-workspace.yaml.example to pnpm-workspace.yaml

Add a setup section clarifying this requirement to prevent confusion and ensure the example is truly runnable in both contexts.

examples/solid/router-monorepo-simple/.vscode/settings.json (1)

1-11: LGTM! Appropriate VS Code configuration for generated files.

The settings correctly exclude routeTree.gen.ts from file watching, search results, and mark it as read-only, which aligns with the autogenerated nature of this file.

examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example (1)

1-2: LGTM! Standard pnpm workspace configuration.

The workspace pattern correctly includes all packages under packages/*, and the .example extension is appropriate for sandbox environments where the file is copied during initialization.

examples/solid/router-monorepo-simple/.stackblitzrc (1)

1-3: LGTM! StackBlitz initialization is properly configured.

The start command correctly copies the workspace configuration from the example file, installs dependencies, and starts the development server in the appropriate sequence.

examples/solid/router-monorepo-simple/packages/app/tsconfig.json (1)

1-13: LGTM! TypeScript configuration follows best practices.

The config appropriately enables strict mode and includes all necessary Solid.js-specific settings (jsx, jsxImportSource). Compiler options are well-suited for a modern Solid.js application.

docs/router/config.json (1)

685-688: LGTM! Documentation navigation entry is correctly configured.

The new "Monorepo basic" entry is properly placed within the Solid Router Examples section and follows the same structure as other example entries. The path correctly references the new example location.

examples/solid/router-monorepo-simple/packages/app/index.html (1)

1-12: LGTM! Standard Vite application entry point.

The HTML structure is appropriate with correct meta tags, a root container for the Solid.js app, and a module script that loads the main TypeScript entry point.

examples/solid/router-monorepo-simple/packages/router/tsconfig.json (1)

1-14: LGTM! TypeScript configuration is well-structured for a library package.

The config enables strict mode and includes appropriate Solid.js settings. The include directive properly scopes compilation to the src directory, which is a good practice for library packages.

examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1)

1-34: LGTM! Component correctly implements Solid.js patterns.

The component appropriately:

  • Calls posts() as an accessor function (line 11), which is correct for Solid.js signals/resources
  • Uses class instead of className for DOM attributes (lines 9, 14, 20-21)
  • Leverages the router API with proper typing via getRouteApi
  • Includes a non-existent post for error handling demonstration

The implementation is well-structured and follows Solid.js conventions.

examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (1)

1-12: LGTM!

Clean root route definition with a proper 404 handler. The notFoundComponent correctly uses the Link component to navigate back to the home page.

examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json (1)

1-13: LGTM!

Proper TypeScript configuration with strict mode enabled and Solid-specific JSX settings. The configuration aligns with the coding guidelines for strict TypeScript usage.

Based on coding guidelines

examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts (1)

1-3: LGTM!

Clean barrel export pattern for the post-feature package's public API surface.

examples/solid/router-monorepo-simple/packages/app/src/style.css (1)

1-13: LGTM!

Standard Tailwind CSS setup with proper dark mode support using color-scheme and theme-aware styling.

examples/solid/router-monorepo-simple/packages/post-feature/package.json (1)

11-11: LGTM!

Correctly uses the workspace:* protocol for the internal router dependency, following the coding guidelines for internal dependencies in monorepos.

Based on coding guidelines

examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1)

1-14: LGTM!

Correct implementation of a Solid Router component. The use of post() as a function call (lines 10-11) is appropriate since Solid's useLoaderData() returns a reactive signal/accessor. The class attribute is also correct for Solid (not className like React).

examples/solid/router-monorepo-simple/README.md (1)

24-24: The asset file is confirmed to exist at examples/solid/router-monorepo-simple/assets/graph.png. No issues found.

examples/solid/router-monorepo-simple/package.json (1)

10-23: Create the pnpm-workspace.yaml configuration file.

The pnpm-workspace.yaml file is missing from the monorepo root. Only pnpm-workspace.yaml.example exists. Without the actual configuration file, pnpm will not recognize this as a workspace, and dependency resolution for workspace:* references in packages/app/package.json will fail.

Create examples/solid/router-monorepo-simple/pnpm-workspace.yaml from the example:

packages:
  - 'packages/*'
⛔ Skipped due to learnings
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/package.json : Use workspace:* protocol for internal dependencies in package.json files
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (1)

1-6: LGTM! Clean file-based route definition.

The dynamic route definition follows best practices for TanStack Router. The loader correctly extracts the postId parameter and passes it to the data fetching function.

examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1)

1-8: LGTM! Index route is correctly configured.

The root route definition properly loads posts data. The loader implementation is straightforward and correct.

examples/solid/router-monorepo-simple/packages/app/package.json (1)

1-35: LGTM! Package configuration follows monorepo best practices.

The package.json correctly uses the workspace:* protocol for internal dependencies (lines 12-13) as per coding guidelines. The NX configuration properly ensures dependencies are built before the dev server starts.

examples/solid/router-monorepo-simple/packages/router/package.json (1)

1-24: LGTM! Library package is correctly configured.

The package is properly set up as a buildable library with appropriate entry points and build configuration. The inclusion of tsc --noEmit in the build script ensures type checking.

examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (1)

1-13: LGTM! Error handling component is well-structured.

The component correctly discriminates between PostNotFoundError and other errors, providing a custom message for the specific case while delegating generic error handling to ErrorComponent.

examples/solid/router-monorepo-simple/packages/app/src/main.tsx (2)

16-32: LGTM! Demonstrates programmatic route configuration.

The routerMap pattern with satisfies Record<RouterIds, ...> provides excellent type safety while allowing programmatic component assignment. The EmptyComponent fallback for routes without explicit components is a sensible default.


35-50: LGTM! Error component mapping follows the same pattern.

The error component assignment logic correctly filters out null entries and updates routes that need custom error handling.

examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (1)

1-23: LGTM! Root component is well-structured.

The component correctly uses Solid.js conventions (class instead of className), configures the navigation link with active state handling, and integrates the router devtools.

examples/solid/router-monorepo-simple/packages/app/vite.config.ts (1)

1-11: LGTM! Vite configuration is well-structured.

The configuration correctly derives __filename and __dirname for ESM modules, configures appropriate ports, and includes the necessary plugins for Solid.js development.

Also applies to: 13-37

examples/solid/router-monorepo-simple/packages/router/vite.config.ts (1)

1-37: LGTM!

The Vite configuration is well-structured with appropriate plugin setup (dts, solid, and tanstackRouter) and correctly externalizes dependencies for library builds.

examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)

1-27: LGTM!

The module augmentation pattern and re-export strategy correctly enforce type safety across the monorepo by ensuring all packages use the registered router instance. The comment on lines 16-17 clearly explains this important pattern.


export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/packages/router',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the cache directory path.

The cacheDir references packages/router but this is the app package configuration. It should reference packages/app instead.

Apply this diff:

-  cacheDir: '../../node_modules/.vite/packages/router',
+  cacheDir: '../../node_modules/.vite/packages/app',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cacheDir: '../../node_modules/.vite/packages/router',
cacheDir: '../../node_modules/.vite/packages/app',
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/app/vite.config.ts around line
12, the cacheDir points to '../../node_modules/.vite/packages/router' which
incorrectly references the router package; update the path to reference this app
package by changing it to '../../node_modules/.vite/packages/app' so Vite uses
the app's cache directory.


export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/packages/router',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Correct the cacheDir path.

The cacheDir references packages/router but this configuration is for the post-feature package. This will cause cache collisions between the two packages.

Apply this diff:

-  cacheDir: '../../node_modules/.vite/packages/router',
+  cacheDir: '../../node_modules/.vite/packages/post-feature',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cacheDir: '../../node_modules/.vite/packages/router',
cacheDir: '../../node_modules/.vite/packages/post-feature',
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
around line 12, the cacheDir points to
'../../node_modules/.vite/packages/router' which causes cache collisions with
the router package; update the cacheDir to a unique path for this package (for
example '../../node_modules/.vite/packages/post-feature') so the post-feature
package uses its own Vite cache.

body: string
}

export class PostNotFoundError extends Error {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Pass error message to parent Error constructor.

The PostNotFoundError class should pass the error message to the parent Error constructor to ensure proper error message handling and stack trace generation.

Apply this diff:

-export class PostNotFoundError extends Error {}
+export class PostNotFoundError extends Error {
+  constructor(message: string) {
+    super(message)
+  }
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export class PostNotFoundError extends Error {}
export class PostNotFoundError extends Error {
constructor(message: string) {
super(message)
}
}
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts
around line 9, the PostNotFoundError class currently doesn't pass a message to
the Error constructor; change it to define a constructor that accepts an
optional message and calls super(message), set this.name = 'PostNotFoundError',
and restore the prototype chain (Object.setPrototypeOf(this,
PostNotFoundError.prototype)) to ensure proper message and stack behavior.

Comment on lines +14 to +22
const post = await axios
.get<PostType>(`https://jsonplaceholder.typicode.com/posts/${postId}`)
.then((r) => r.data)
.catch((err) => {
if (err.status === 404) {
throw new PostNotFoundError(`Post with id "${postId}" not found!`)
}
throw err
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify error property access for redaxios.

The code accesses err.status to check for 404 errors. Ensure that redaxios exposes the status code on the error object in this manner. Some HTTP libraries nest the status code differently (e.g., err.response.status).

Run the following script to check the redaxios documentation or implementation:


🌐 Web query:

Does redaxios expose HTTP status codes as err.status or err.response.status?

💡 Result:

redaxios follows the axios API: HTTP error status is on err.response.status (not err.status). [1][2]

Sources:

  1. redaxios package description (uses Axios API). [npm redaxios]. [1]
  2. Axios docs — error handling shows status on error.response.status. [2]

Fix error property access: use err.response.status instead of err.status.

Based on redaxios documentation, which follows the axios API, HTTP error status codes are exposed on err.response.status, not err.status. The current code accessing err.status will fail because that property is undefined. Change line 18 from if (err.status === 404) to if (err.response?.status === 404) (or if (err.response && err.response.status === 404)).

🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts
around lines 14 to 22, the catch handler incorrectly checks err.status which is
undefined for axios/redaxios errors; change the check to use
err.response?.status (or explicit err.response && err.response.status) and throw
PostNotFoundError when that equals 404, otherwise rethrow the original error.

Comment on lines +9 to +11
defaultPendingComponent: () => (
<div>Loading form global pending component...</div>
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo in loading message.

Line 10 contains a typo: "Loading form global pending component..." should read "Loading from global pending component...".

Apply this diff to fix the typo:

   defaultPendingComponent: () => (
-    <div>Loading form global pending component...</div>
+    <div>Loading from global pending component...</div>
   ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
defaultPendingComponent: () => (
<div>Loading form global pending component...</div>
),
defaultPendingComponent: () => (
<div>Loading from global pending component...</div>
),
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/router/src/router.tsx around
lines 9 to 11, there is a typo in the defaultPendingComponent text ("Loading
form global pending component..."); change "form" to "from" so the message reads
"Loading from global pending component..." and save the file.

Comment on lines +5 to +6
- `npm install` or `yarn`
- `npm dev` or `yarn dev`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update package manager instructions to match the project setup.

The installation commands reference npm and yarn, but the root package.json uses pnpm workspace filtering (lines 5-8). Update the commands to reflect pnpm install and pnpm dev for consistency.

Apply this diff:

-- `npm install` or `yarn`
-- `npm dev` or `yarn dev`
+- `pnpm install`
+- `pnpm dev`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `npm install` or `yarn`
- `npm dev` or `yarn dev`
- `pnpm install`
- `pnpm dev`
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/README.md around lines 5 to 6, the
README lists npm/yarn commands but the repository uses pnpm workspaces; update
the instructions to use pnpm by replacing "npm install" or "yarn" with "pnpm
install" (or "pnpm i") and replace "npm dev" or "yarn dev" with "pnpm dev" (or
the appropriate pnpm workspace-filtered dev command) so the commands match the
project's pnpm setup.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (4)
examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json (1)

1-13: Add "include" field for consistency.

The post-feature package's TypeScript config is missing the "include" field that's present in the router package config. For consistency across the monorepo packages, consider adding it.

Apply this diff:

   "compilerOptions": {
     "strict": true,
     "esModuleInterop": true,
     "jsx": "preserve",
     "jsxImportSource": "solid-js",
     "target": "ESNext",
     "moduleResolution": "Bundler",
     "module": "ESNext",
     "lib": ["DOM", "DOM.Iterable", "ES2022"],
     "skipLibCheck": true
-  }
+  },
+  "include": ["src"]
 }
examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1)

4-8: Consider simplifying the loader.

The arrow function wrapper is redundant since fetchPosts already returns the expected value.

Apply this diff to simplify:

-export const Route = createFileRoute('/')({
-  loader: () => {
-    return fetchPosts()
-  },
-})
+export const Route = createFileRoute('/')({
+  loader: fetchPosts,
+})
examples/solid/router-monorepo-simple/packages/app/package.json (1)

24-24: Consider removing unnecessary devDependency.

vite-plugin-dts is typically used for generating TypeScript declaration files in library packages. Since this is an app package (not a library), this dependency may not be needed.

If TypeScript declarations aren't required for this app package, consider removing this line:

-    "vite-plugin-dts": "^4.5.4"
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)

9-9: Consider adding an explicit constructor.

While the default constructor behavior works, explicitly defining the constructor improves clarity and maintainability.

Apply this diff:

-export class PostNotFoundError extends Error {}
+export class PostNotFoundError extends Error {
+  constructor(message: string) {
+    super(message)
+    this.name = 'PostNotFoundError'
+  }
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 606dd19 and 349c67b.

⛔ Files ignored due to path filters (2)
  • examples/solid/router-monorepo-simple/assets/graph.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (31)
  • docs/router/config.json (1 hunks)
  • examples/solid/router-monorepo-simple/.gitignore (1 hunks)
  • examples/solid/router-monorepo-simple/.stackblitzrc (1 hunks)
  • examples/solid/router-monorepo-simple/.vscode/settings.json (1 hunks)
  • examples/solid/router-monorepo-simple/README.md (1 hunks)
  • examples/solid/router-monorepo-simple/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/index.html (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/src/style.css (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/app/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/package.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-simple/packages/app/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
examples/{react,solid}/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep example applications under examples/react/ and examples/solid/

Files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/app/index.html
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-simple/packages/app/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
  • examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/app/src/style.css
docs/{router,start}/**

📄 CodeRabbit inference engine (AGENTS.md)

Place router docs under docs/router/ and start framework docs under docs/start/

Files:

  • docs/router/config.json
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace:* protocol for internal dependencies in package.json files

Files:

  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to docs/{router,start}/** : Place router docs under docs/router/ and start framework docs under docs/start/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-plugin/** : Use unplugin for universal bundler plugins in the router-plugin package
Learnt from: FatahChan
Repo: TanStack/router PR: 5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/src/routes/** : Place file-based routes under src/routes/ directories

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • docs/router/config.json
  • examples/solid/router-monorepo-simple/packages/app/index.html
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-simple/packages/app/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-simple/.stackblitzrc
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-simple/packages/app/src/style.css
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to docs/{router,start}/** : Place router docs under docs/router/ and start framework docs under docs/start/

Applied to files:

  • docs/router/config.json
  • examples/solid/router-monorepo-simple/README.md
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/

Applied to files:

  • docs/router/config.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories

Applied to files:

  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/

Applied to files:

  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/package.json
  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/post-feature/package.json
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/package.json : Use workspace:* protocol for internal dependencies in package.json files

Applied to files:

  • examples/solid/router-monorepo-simple/packages/app/package.json
  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/.gitignore
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/.vscode/settings.json
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/src/router.tsx
  • examples/solid/router-monorepo-simple/README.md
  • examples/solid/router-monorepo-simple/packages/app/src/main.tsx
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
  • examples/solid/router-monorepo-simple/packages/router/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-plugin/** : Use unplugin for universal bundler plugins in the router-plugin package

Applied to files:

  • examples/solid/router-monorepo-simple/packages/router/package.json
  • examples/solid/router-monorepo-simple/packages/router/vite.config.ts
  • examples/solid/router-monorepo-simple/packages/router/src/index.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

Applied to files:

  • examples/solid/router-monorepo-simple/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/router/tsconfig.json
  • examples/solid/router-monorepo-simple/packages/app/tsconfig.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{*-start,start-*}/** : Name and place Start framework packages under packages/*-start/ or packages/start-*/

Applied to files:

  • examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example
🧬 Code graph analysis (14)
examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
  • fetchPosts (27-33)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (2)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (3)
  • getRouteApi (24-24)
  • Link (20-20)
  • Outlet (19-19)
examples/react/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1)
  • PostsListComponent (5-34)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (3)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)
  • getRouteApi (24-24)
examples/react/router-monorepo-simple-lazy/packages/post-feature/src/PostIdPage.tsx (1)
  • PostIdComponent (7-16)
examples/react/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1)
  • PostIdComponent (5-14)
examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (2)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (2)
  • Link (20-20)
  • Outlet (19-19)
examples/react/router-monorepo-simple/packages/app/src/rootComponent.tsx (1)
  • RootComponent (4-23)
examples/solid/router-monorepo-simple/packages/app/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-simple/packages/router/src/router.tsx (1)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (3)
  • router (12-12)
  • RouterType (3-3)
  • RouterIds (3-3)
examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (2)
examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (1)
  • Route (4-6)
examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-simple/packages/app/src/main.tsx (5)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1)
  • PostsListComponent (5-34)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1)
  • PostIdComponent (5-14)
examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (1)
  • RootComponent (4-23)
examples/solid/router-monorepo-simple/packages/router/src/router.tsx (2)
  • RouterIds (16-16)
  • router (7-13)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (1)
  • PostErrorComponent (7-13)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)
  • PostNotFoundError (14-14)
examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-simple/packages/router/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (3)
examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (1)
  • Route (3-12)
examples/solid/router-monorepo-simple/packages/router/src/routes/index.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
  • fetchPost (11-25)
examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (2)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (3)
  • ErrorComponentProps (27-27)
  • PostNotFoundError (14-14)
  • ErrorComponent (25-25)
examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts (1)
  • PostNotFoundError (9-9)
examples/solid/router-monorepo-simple/packages/router/src/index.ts (1)
examples/solid/router-monorepo-simple/packages/router/src/router.tsx (1)
  • router (7-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Preview
🔇 Additional comments (33)
examples/solid/router-monorepo-simple/packages/app/src/style.css (1)

1-13: LGTM!

The Tailwind CSS setup is clean and demonstrates proper dark mode support through the color-scheme property and Tailwind's dark mode utilities. The file placement aligns with the example application structure, and the styling follows standard Tailwind conventions.

examples/solid/router-monorepo-simple/.gitignore (3)

6-6: Verify that ignoring all .js files is intentional.

The pattern *.js will ignore all JavaScript files in the repository. In a monorepo example with build tooling, this may inadvertently ignore necessary files such as configuration files, CLI scripts, or other checked-in JavaScript artifacts. If the intent is to ignore only build outputs, consider scoping the pattern to specific directories (e.g., dist/*.js, dist-ssr/*.js).


13-13: Clarify whether pnpm-workspace.yaml should be ignored in an example.

Ignoring the workspace configuration file in a monorepo example is unusual, as examples should be self-contained and demonstrate the correct project structure to users. If the intent is to provide a template, ensure a corresponding pnpm-workspace.yaml.example file exists and is documented so users understand how to initialize the workspace.


1-5: Standard .gitignore patterns look good.

The common entries for build outputs (node_modules, dist, dist-ssr), local artifacts (.DS_Store, *.local), and test results are appropriate and follow standard practices.

Also applies to: 8-11

examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts (2)

1-8: LGTM!

Standard ESM setup for path handling is correct.


34-40: Verify self-externalization is intentional.

The external list includes '@router-solid-mono-simple/post-feature' which is the package itself. Typically, you externalize dependencies but not the package being built. This might be a copy/paste error or could be intentional for handling specific monorepo edge cases.

Please confirm whether this self-externalization is necessary or should be removed.

If this is an error, apply this diff to remove the self-reference:

       external: [
         'solid-js',
         'solid-js/web',
         '@tanstack/solid-router',
-        '@router-solid-mono-simple/post-feature',
         '@router-solid-mono-simple/router',
       ],
examples/solid/router-monorepo-simple/.stackblitzrc (1)

1-3: LGTM!

The StackBlitz startup command correctly initializes the workspace by copying the example file, installing dependencies, and starting the dev server.

examples/solid/router-monorepo-simple/packages/router/tsconfig.json (1)

1-14: LGTM!

The TypeScript configuration properly enables strict mode and SolidJS JSX support, aligning with the coding guidelines.

examples/solid/router-monorepo-simple/packages/router/src/routes/__root.tsx (1)

1-12: LGTM!

The root route configuration correctly implements a custom notFoundComponent with appropriate navigation.

examples/solid/router-monorepo-simple/package.json (1)

1-27: LGTM!

The root package.json correctly configures workspace scripts and declares external dependencies. The pnpm filter commands properly target workspace packages.

examples/solid/router-monorepo-simple/pnpm-workspace.yaml.example (1)

1-2: LGTM!

The workspace configuration correctly defines the packages pattern for the monorepo structure.

examples/solid/router-monorepo-simple/.vscode/settings.json (1)

1-11: LGTM!

The VSCode settings appropriately exclude the autogenerated route tree file from watchers, searches, and mark it as readonly, preventing accidental modifications.

docs/router/config.json (1)

685-688: LGTM!

The documentation config correctly adds the new Solid monorepo example with appropriate labeling and path. Based on learnings.

examples/solid/router-monorepo-simple/packages/app/index.html (1)

1-12: LGTM!

Standard HTML5 entrypoint for a Vite-based Solid.js application. The structure is correct and follows Vite conventions.

examples/solid/router-monorepo-simple/packages/app/tsconfig.json (1)

1-13: LGTM!

TypeScript configuration is properly set up with strict mode enabled and correct Solid.js JSX settings. The configuration aligns with coding guidelines and modern tooling requirements.

examples/solid/router-monorepo-simple/packages/post-feature/package.json (1)

1-20: LGTM!

Package manifest is correctly configured with workspace protocol for internal dependencies and appropriate build tooling for a library package.

examples/solid/router-monorepo-simple/packages/router/package.json (1)

1-24: LGTM!

Package manifest is properly configured with appropriate dependencies for a router library package. Build tooling and output configuration are correct.

examples/solid/router-monorepo-simple/packages/post-feature/src/PostIdPage.tsx (1)

1-14: LGTM!

Component correctly uses Solid.js patterns: reactive data accessed as functions (post().title), and the class attribute instead of React's className. The implementation properly integrates with the router's loader data.

examples/solid/router-monorepo-simple/packages/app/vite.config.ts (1)

23-28: Consider whether vite-plugin-dts is needed for an app package.

The vite-plugin-dts plugin generates TypeScript declaration files, which is typically used for library packages that need to expose types to consumers. Since this is an application package (not a library), generating .d.ts files may be unnecessary. If the app is not being consumed as a library by other packages, consider removing this plugin.

Is the app package intended to be consumed as a library by other packages in the monorepo?

examples/solid/router-monorepo-simple/packages/router/src/routes/$postId.ts (1)

1-6: LGTM!

Route definition is clean and correctly implements dynamic routing with proper parameter extraction. The loader appropriately delegates to the fetchPost function with the route parameter.

examples/solid/router-monorepo-simple/packages/router/vite.config.ts (1)

1-37: LGTM! Well-structured Vite library configuration.

The configuration correctly sets up a Solid.js library with TypeScript declarations, proper externals, and TanStack Router plugin integration.

examples/solid/router-monorepo-simple/README.md (1)

1-30: LGTM! Clear and helpful documentation.

The README effectively explains the monorepo setup, TypeScript augmentation challenges, and the solution architecture.

examples/solid/router-monorepo-simple/packages/app/src/main.tsx (3)

16-32: LGTM! Type-safe route-to-component mapping.

The approach of using satisfies with RouterIds ensures type safety while the runtime loop correctly updates the router configuration. The fallback to EmptyComponent provides a safe default.


34-50: LGTM! Error component mapping is well-structured.

The error component map follows a consistent pattern and appropriately handles null entries with an early return.


52-56: LGTM! Safe render initialization.

The innerHTML check before rendering is a good practice to avoid re-mounting in development environments with HMR.

examples/solid/router-monorepo-simple/packages/post-feature/src/PostError.tsx (1)

1-13: LGTM! Clean error handling component.

The component effectively handles the specific PostNotFoundError case while falling back to the generic ErrorComponent for other errors.

examples/solid/router-monorepo-simple/packages/app/src/rootComponent.tsx (1)

1-23: LGTM! Well-structured root component.

The component correctly uses Solid.js syntax and integrates the router devtools. The navigation and outlet structure is clean and follows TanStack Router patterns.

examples/solid/router-monorepo-simple/packages/post-feature/src/PostList.tsx (1)

1-34: LGTM! Solid.js component with proper patterns.

The component correctly uses Solid.js reactivity patterns (calling posts() as a function) and demonstrates type-safe navigation with the router. The inclusion of a non-existent post effectively showcases error handling capabilities.

examples/solid/router-monorepo-simple/packages/router/src/router.tsx (1)

1-16: Router configuration looks good overall.

The router is properly configured with the generated route tree and appropriate default options.

examples/solid/router-monorepo-simple/packages/app/package.json (1)

1-35: Package configuration follows monorepo best practices.

The package correctly uses the workspace:* protocol for internal dependencies and includes appropriate scripts and nx configuration.

examples/solid/router-monorepo-simple/packages/post-feature/src/index.ts (1)

1-3: LGTM! Clean barrel exports.

The barrel export pattern correctly establishes the public API surface for the post-feature package.

examples/solid/router-monorepo-simple/packages/router/src/index.ts (2)

1-12: LGTM! Solid module augmentation pattern.

The type augmentation correctly registers the router instance with @tanstack/solid-router, enabling type-safe routing across the monorepo.


16-27: LGTM! Well-architected re-export strategy.

Re-exporting the TanStack Router API through this package ensures that the type registration is consistently applied across the monorepo. The comment clearly explains the architectural decision.


export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/packages/router',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix incorrect cacheDir path.

The cache directory references packages/router but this is the app package configuration. This will cause Vite to use the wrong cache location.

Apply this diff:

-  cacheDir: '../../node_modules/.vite/packages/router',
+  cacheDir: '../../node_modules/.vite/packages/app',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cacheDir: '../../node_modules/.vite/packages/router',
cacheDir: '../../node_modules/.vite/packages/app',
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/app/vite.config.ts around line
12, the cacheDir is incorrectly set to
'../../node_modules/.vite/packages/router' (points to the router package);
change it to the app package cache path such as
'../../node_modules/.vite/packages/app' so Vite uses the correct cache directory
for this app package.


export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/packages/router',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the cache directory path.

The cacheDir points to packages/router but this configuration is for the post-feature package. This appears to be a copy/paste error and would cause Vite to cache in the wrong location.

Apply this diff to fix the cache directory:

-  cacheDir: '../../node_modules/.vite/packages/router',
+  cacheDir: '../../node_modules/.vite/packages/post-feature',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cacheDir: '../../node_modules/.vite/packages/router',
cacheDir: '../../node_modules/.vite/packages/post-feature',
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
around line 12, the cacheDir is incorrectly set to
'../../node_modules/.vite/packages/router' (copy/paste error); update it to
point to this package by changing the path to
'../../node_modules/.vite/packages/post-feature' so Vite caches under the
post-feature folder.

Comment on lines +26 to +31
lib: {
entry: 'src/index.ts',
name: 'router',
fileName: 'index',
formats: ['es'],
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Correct the library name.

The library name is set to 'router' but this configuration is for the post-feature package. While this primarily affects UMD format (not currently used), it's misleading in an example that users learn from.

Apply this diff to fix the library name:

     lib: {
       entry: 'src/index.ts',
-      name: 'router',
+      name: 'post-feature',
       fileName: 'index',
       formats: ['es'],
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
lib: {
entry: 'src/index.ts',
name: 'router',
fileName: 'index',
formats: ['es'],
},
lib: {
entry: 'src/index.ts',
name: 'post-feature',
fileName: 'index',
formats: ['es'],
},
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/post-feature/vite.config.ts
around lines 26 to 31, the library name is incorrectly set to 'router'; update
the lib.name to 'post-feature' (the package's actual name) so the build metadata
matches the package and avoids misleading examples; keep the rest of the lib
config unchanged.

Comment on lines +11 to +25
export const fetchPost = async (postId: string) => {
console.info(`Fetching post with id ${postId}...`)
await new Promise((r) => setTimeout(r, 500))
const post = await axios
.get<PostType>(`https://jsonplaceholder.typicode.com/posts/${postId}`)
.then((r) => r.data)
.catch((err) => {
if (err.status === 404) {
throw new PostNotFoundError(`Post with id "${postId}" not found!`)
}
throw err
})

return post
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify redaxios error structure for 404 handling.

Ensure that redaxios exposes the status code at err.status rather than err.response.status (as in standard axios). If the error structure differs, the 404 check on line 18 may not work correctly, and errors would be re-thrown without being mapped to PostNotFoundError.


🏁 Script executed:

#!/bin/bash
# Verify redaxios error structure documentation and usage patterns

# Search for redaxios error handling examples in the repository
rg -nP -C3 'redaxios.*catch|catch.*err\.status' --type=ts

# Check package.json for redaxios version
fd -e json package.json --exec grep -H "redaxios"

Length of output: 9821


I need to verify the redaxios error structure and examine the target file.


---

🏁 Script executed:

```shell
#!/bin/bash
# Examine the actual target file
cat examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts

Length of output: 858



---

🏁 Script executed:

```shell
#!/bin/bash
# Search for any other error handling with redaxios in the codebase to see patterns
rg -nP -C3 'catch.*err|err\.' examples/solid/router-monorepo-simple/packages/router/src --type=ts | head -50

Length of output: 887



---

🌐 Web query:

```web
redaxios error object structure err.status vs err.response.status

💡 Result:

Short answer: redaxios mimics the Axios API but uses fetch under the hood, so you should read HTTP status from err.response.status (and fall back to other places). In practice check err.response?.status first, then err.status, then err.request?.status (or err.code) as a fallback.

Why / guidance:

  • redaxios advertises an Axios‑compatible API (fetch adapter), so error shape is intended to follow Axios semantics (response on server replies). [1]
  • Axios documents the error shape: when the server replied the status is on error.response.status; some Axios builds also expose a top‑level error.status on the AxiosError, but that is not always present (network/no‑response errors have no response). Use optional chaining and fallbacks. [2]

Minimal example:
try {
await axios.get('/x');
} catch (err) {
const status = err?.response?.status ?? err?.status ?? err?.request?.status ?? null;
// handle by status
}

Sources:
[1] redaxios (package/README) — redaxios aims to provide the Axios API using fetch.
[2] Axios docs — Handling Errors: response object and recommended access to response.status.


Fix error status check to use err.response?.status for redaxios compatibility.

The error handling on line 18 checks err.status, but redaxios follows Axios semantics where the status code is at err.response.status. The current check will not reliably catch 404 errors. Use err.response?.status ?? err.status to safely access the status with a fallback.

if (err.response?.status === 404 || err.status === 404) {
  throw new PostNotFoundError(`Post with id "${postId}" not found!`)
}
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/router/src/fetch/posts.ts
around lines 11 to 25, the error handler checks err.status which misses
redaxios/axios semantics where HTTP status is on err.response.status; update the
check to read the status safely (e.g., use err.response?.status ?? err.status or
explicitly check err.response?.status === 404 || err.status === 404) and throw
PostNotFoundError when that resolved status equals 404; ensure the code uses
optional chaining to avoid accessing response on undefined.

Comment on lines +9 to +10
defaultPendingComponent: () => (
<div>Loading form global pending component...</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo in loading message.

"Loading form" should be "Loading from".

Apply this diff:

-    <div>Loading form global pending component...</div>
+    <div>Loading from global pending component...</div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
defaultPendingComponent: () => (
<div>Loading form global pending component...</div>
defaultPendingComponent: () => (
<div>Loading from global pending component...</div>
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-simple/packages/router/src/router.tsx around
lines 9 to 10, fix the typo in the loading message by changing "Loading form
global pending component..." to "Loading from global pending component..." so
the text reads correctly; update the JSX string accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants