Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Oct 20, 2025

Summary by CodeRabbit

  • Tests

    • Added comprehensive end-to-end test suite for Solid Start virtual routes with configuration, test cases, and setup/teardown utilities.
  • Chores

    • Added project configuration, environment setup, and build tooling for the test environment.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Walkthrough

Adds a complete new end-to-end test application at e2e/solid-start/virtual-routes/ for testing Solid Start with virtual file-based routing. Includes configuration, route definitions, generated route tree, utilities, styles, test setup, and test cases.

Changes

Cohort / File(s) Summary
Configuration & Build Setup
.gitignore, .prettierignore, package.json, postcss.config.mjs, tailwind.config.mjs, tsconfig.json, vite.config.ts
Project configuration files defining dependencies, dev scripts, build tooling (Tailwind, PostCSS, Vite, Playwright), TypeScript settings, and Vite plugins for virtual routes. Package includes Solid Start, TanStack Router, and DevTools.
Router & Route Tree
routes.ts, src/router.tsx, src/routeTree.gen.ts
Declarative route schema with nested file-based routes at /posts, /layout, /classic/hello; generated routeTree with type definitions and module augmentations; router factory function getRouter() initializing the router instance.
Route Components
src/routes/home.tsx, src/routes/root.tsx, src/routes/posts/*.tsx, src/routes/layout/*.tsx, src/routes/a.tsx, src/routes/b.tsx, src/routes/file-based-subtree/hello/*.tsx
File-based route definitions using createFileRoute and createRootRoute, rendering layout components, post list/detail pages, and nested layouts with navigation and data loaders.
Utilities & Styles
src/posts.tsx, src/utils/posts.tsx, src/utils/seo.ts, src/utils/users.tsx, src/styles/app.css
Server functions for fetching posts with error handling and artificial delays; SEO utility for meta tag construction; User type and deployment URL constant; Tailwind base styles with light/dark mode support.
Public Assets
public/script.js, public/script2.js, public/site.webmanifest
Global scripts logging load status; PWA manifest with app metadata, icons, and standalone display mode.
Test Infrastructure
playwright.config.ts, tests/setup/global.setup.ts, tests/setup/global.teardown.ts, tests/app.spec.ts
Playwright configuration with single-worker test setup, web server launch, global setup/teardown for dummy server lifecycle; e2e test suite verifying post navigation, nested layout navigation, and not-found route handling.

Sequence Diagram

sequenceDiagram
    participant Browser
    participant Vite as Vite Server
    participant Router as Solid Router
    participant UI as Route Component
    participant API as Dummy Server

    Browser->>Vite: Start dev/test server
    Vite->>Vite: Load virtual routes (routes.ts)
    Vite->>Browser: Inject routeTree.gen.ts types & Router
    
    Browser->>Router: Initialize router via getRouter()
    Router->>Router: Attach routeTree with preload config
    
    rect rgb(200, 220, 255)
    Note over Browser,Router: Navigation Flow
    Browser->>UI: User navigates to /posts
    UI->>Router: Trigger loader (fetchPosts)
    Router->>API: GET /posts (with 500ms delay)
    API-->>Router: Return post list
    UI->>Browser: Render posts list with links
    end
    
    rect rgb(200, 220, 255)
    Note over Browser,Router: Nested Layout Navigation
    Browser->>UI: User navigates to /_first/_second-layout
    Router->>Router: Compose first + second layout tree
    UI->>Browser: Render nested layouts with Outlet
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Rationale: Large scope spanning 30+ files across multiple domains (configuration, routes, utilities, tests, generated code). While many route files follow repetitive patterns (reducing per-file effort), the generated routeTree.gen.ts is logic-dense with extensive type augmentations and module declarations. Requires careful review of router initialization, loader/data-fetching wiring, and test coverage logic.

Possibly related PRs

  • #5363: Adds similar generated routeTree and getRouter() helper for another e2e target, mirroring the router factory and type module augmentation pattern.
  • #5260: Parallel e2e app scaffold with identical routeTree/router architecture and similar utility functions (posts, seo, users), indicating synchronized example/test setup expansion.
  • #5254: Adds full example app with file-based routes, generated routeTree, and router initialization pattern, sharing the same architectural approach.

Suggested labels

package: solid-start, package: solid-router

Suggested reviewers

  • schiller-manuel
  • brenelz

Poem

🐰 A new route tree takes its form,
With virtual paths keeping warm,
Tests dance through layouts stacked high,
Posts load and nested loaders fly,
Solid Start's e2e path—all routes comply! 🎯

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 PR title "test(solid-start): add virtual-routes e2e suite" accurately and clearly describes the primary change in the pull request. The changeset introduces a complete end-to-end test suite for Solid Start with virtual routes, spanning configuration files, route definitions, test files, and setup utilities all within the e2e/solid-start/virtual-routes/ directory. The title uses conventional commit format, is concise and specific, avoids vague terminology, and directly conveys what is being added without unnecessary noise or file listings.
✨ 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 solid-start-virtual-routes-e2e

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 Oct 20, 2025

View your CI Pipeline Execution ↗ for commit 67785aa

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

☁️ Nx Cloud last updated this comment at 2025-10-20 23:35:01 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 20, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 67785aa

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

🧹 Nitpick comments (8)
e2e/solid-start/virtual-routes/src/utils/seo.ts (1)

1-11: LGTM! Function signature follows established pattern.

The type annotations are correct and match the reference implementation. Optionally, consider adding an explicit return type annotation for improved type safety and documentation.

Apply this diff to add explicit return type:

 export const seo = ({
   title,
   description,
   keywords,
   image,
 }: {
   title: string
   description?: string
   image?: string
   keywords?: string
-}) => {
+}): Array<Record<string, string | undefined>> => {
e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx (2)

21-23: Ensure route param is a string

JSONPlaceholder ids are numbers; params must be strings. Cast at the callsite.

-                    postId: post.id,
+                    postId: String(post.id),

14-33: Prefer Solid’s for lists

Improves reactivity/perf and avoids spreading arrays.

-      <ul class="list-disc pl-4">
-        {[...posts(), { id: 'i-do-not-exist', title: 'Non-existent Post' }].map(
-          (post) => {
-            return (
-              <li class="whitespace-nowrap">
-                <Link
-                  to="/posts/$postId"
-                  params={{
-                    postId: post.id,
-                  }}
-                  class="block py-1 text-blue-600 hover:opacity-75"
-                  activeProps={{ class: 'font-bold underline' }}
-                >
-                  <div>{post.title.substring(0, 20)}</div>
-                </Link>
-              </li>
-            )
-          },
-        )}
-      </ul>
+      <ul class="list-disc pl-4">
+        <For each={[...posts(), { id: 'i-do-not-exist', title: 'Non-existent Post' }]}>
+          {(post) => (
+            <li class="whitespace-nowrap">
+              <Link
+                to="/posts/$postId"
+                params={{ postId: String(post.id) }}
+                class="block py-1 text-blue-600 hover:opacity-75"
+                activeProps={{ class: 'font-bold underline' }}
+              >
+                <div>{post.title.substring(0, 20)}</div>
+              </Link>
+            </li>
+          )}
+        </For>
+      </ul>
e2e/solid-start/virtual-routes/playwright.config.ts (3)

29-34: Use webServer.env instead of inline env assignment (Windows-safe)

Inline VAR=… cmd chaining breaks on Windows shells. Prefer Playwright’s env.

-  webServer: {
-    command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`,
-    url: baseURL,
-    reuseExistingServer: !process.env.CI,
-    stdout: 'pipe',
-  },
+  webServer: {
+    command: `pnpm build && pnpm start`,
+    url: baseURL,
+    reuseExistingServer: !process.env.CI,
+    stdout: 'pipe',
+    env: {
+      VITE_NODE_ENV: 'test',
+      VITE_EXTERNAL_PORT: String(EXTERNAL_PORT),
+      VITE_SERVER_PORT: String(PORT),
+      PORT: String(PORT),
+    },
+  },

6-6: JSON import attribute compatibility

Importing JSON with “with { type: 'json' }” requires newer Node/TS. If your CI runs Node ≤20/TS <5.4, switch to assert syntax or read via fs.

- import packageJson from './package.json' with { type: 'json' }
+ // Option A (Node 20+/TS with resolveJsonModule): 
+ // import packageJson from './package.json' assert { type: 'json' }
+ // Option B (always works):
+ // import { readFileSync } from 'node:fs'
+ // const packageJson = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8'))

15-21: Minor runner hygiene (optional)

Add forbidOnly/retries for CI stability.

 export default defineConfig({
   testDir: './tests',
   workers: 1,
 
-  reporter: [['line']],
+  reporter: [['line']],
+  forbidOnly: !!process.env.CI,
+  retries: process.env.CI ? 2 : 0,
e2e/solid-start/virtual-routes/src/utils/posts.tsx (2)

5-9: Align PostType.id with upstream API

JSONPlaceholder returns numeric ids. Either type as number or normalize to string consistently. Recommend accurate typing + cast at Link usage.

-export type PostType = {
-  id: string
+export type PostType = {
+  id: number
   title: string
   body: string
 }

Then keep String(post.id) where building params (see posts.tsx diff). Based on learnings.


17-19: Tighten input validation

Guard against empty/whitespace ids to fail fast.

-  .inputValidator((postId: string) => postId)
+  .inputValidator((postId: string) => {
+    if (!postId || !String(postId).trim()) throw new Error('postId required')
+    return postId
+  })
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5128836 and 67785aa.

⛔ Files ignored due to path filters (8)
  • e2e/solid-start/virtual-routes/public/android-chrome-192x192.png is excluded by !**/*.png
  • e2e/solid-start/virtual-routes/public/android-chrome-512x512.png is excluded by !**/*.png
  • e2e/solid-start/virtual-routes/public/apple-touch-icon.png is excluded by !**/*.png
  • e2e/solid-start/virtual-routes/public/favicon-16x16.png is excluded by !**/*.png
  • e2e/solid-start/virtual-routes/public/favicon-32x32.png is excluded by !**/*.png
  • e2e/solid-start/virtual-routes/public/favicon.ico is excluded by !**/*.ico
  • e2e/solid-start/virtual-routes/public/favicon.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (35)
  • e2e/solid-start/virtual-routes/.gitignore (1 hunks)
  • e2e/solid-start/virtual-routes/.prettierignore (1 hunks)
  • e2e/solid-start/virtual-routes/package.json (1 hunks)
  • e2e/solid-start/virtual-routes/playwright.config.ts (1 hunks)
  • e2e/solid-start/virtual-routes/postcss.config.mjs (1 hunks)
  • e2e/solid-start/virtual-routes/public/script.js (1 hunks)
  • e2e/solid-start/virtual-routes/public/script2.js (1 hunks)
  • e2e/solid-start/virtual-routes/public/site.webmanifest (1 hunks)
  • e2e/solid-start/virtual-routes/routes.ts (1 hunks)
  • e2e/solid-start/virtual-routes/src/posts.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routeTree.gen.ts (1 hunks)
  • e2e/solid-start/virtual-routes/src/router.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/a.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/b.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/home.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/routes/root.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/styles/app.css (1 hunks)
  • e2e/solid-start/virtual-routes/src/utils/posts.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/src/utils/seo.ts (1 hunks)
  • e2e/solid-start/virtual-routes/src/utils/users.tsx (1 hunks)
  • e2e/solid-start/virtual-routes/tailwind.config.mjs (1 hunks)
  • e2e/solid-start/virtual-routes/tests/app.spec.ts (1 hunks)
  • e2e/solid-start/virtual-routes/tests/setup/global.setup.ts (1 hunks)
  • e2e/solid-start/virtual-routes/tests/setup/global.teardown.ts (1 hunks)
  • e2e/solid-start/virtual-routes/tsconfig.json (1 hunks)
  • e2e/solid-start/virtual-routes/vite.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

Store end-to-end tests under the e2e/ directory

Files:

  • e2e/solid-start/virtual-routes/tsconfig.json
  • e2e/solid-start/virtual-routes/public/script.js
  • e2e/solid-start/virtual-routes/src/utils/users.tsx
  • e2e/solid-start/virtual-routes/postcss.config.mjs
  • e2e/solid-start/virtual-routes/src/utils/seo.ts
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx
  • e2e/solid-start/virtual-routes/src/routes/home.tsx
  • e2e/solid-start/virtual-routes/tailwind.config.mjs
  • e2e/solid-start/virtual-routes/public/site.webmanifest
  • e2e/solid-start/virtual-routes/public/script2.js
  • e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx
  • e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx
  • e2e/solid-start/virtual-routes/tests/setup/global.teardown.ts
  • e2e/solid-start/virtual-routes/src/router.tsx
  • e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx
  • e2e/solid-start/virtual-routes/tests/setup/global.setup.ts
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx
  • e2e/solid-start/virtual-routes/routes.ts
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx
  • e2e/solid-start/virtual-routes/src/styles/app.css
  • e2e/solid-start/virtual-routes/src/routes/root.tsx
  • e2e/solid-start/virtual-routes/src/posts.tsx
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx
  • e2e/solid-start/virtual-routes/tests/app.spec.ts
  • e2e/solid-start/virtual-routes/playwright.config.ts
  • e2e/solid-start/virtual-routes/src/routes/a.tsx
  • e2e/solid-start/virtual-routes/src/routeTree.gen.ts
  • e2e/solid-start/virtual-routes/src/routes/b.tsx
  • e2e/solid-start/virtual-routes/package.json
  • e2e/solid-start/virtual-routes/src/utils/posts.tsx
  • e2e/solid-start/virtual-routes/vite.config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • e2e/solid-start/virtual-routes/src/utils/users.tsx
  • e2e/solid-start/virtual-routes/src/utils/seo.ts
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx
  • e2e/solid-start/virtual-routes/src/routes/home.tsx
  • e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx
  • e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx
  • e2e/solid-start/virtual-routes/tests/setup/global.teardown.ts
  • e2e/solid-start/virtual-routes/src/router.tsx
  • e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx
  • e2e/solid-start/virtual-routes/tests/setup/global.setup.ts
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx
  • e2e/solid-start/virtual-routes/routes.ts
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx
  • e2e/solid-start/virtual-routes/src/routes/root.tsx
  • e2e/solid-start/virtual-routes/src/posts.tsx
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx
  • e2e/solid-start/virtual-routes/tests/app.spec.ts
  • e2e/solid-start/virtual-routes/playwright.config.ts
  • e2e/solid-start/virtual-routes/src/routes/a.tsx
  • e2e/solid-start/virtual-routes/src/routeTree.gen.ts
  • e2e/solid-start/virtual-routes/src/routes/b.tsx
  • e2e/solid-start/virtual-routes/src/utils/posts.tsx
  • e2e/solid-start/virtual-routes/vite.config.ts
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx
  • e2e/solid-start/virtual-routes/src/routes/home.tsx
  • e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx
  • e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx
  • e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx
  • e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx
  • e2e/solid-start/virtual-routes/src/routes/root.tsx
  • e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx
  • e2e/solid-start/virtual-routes/src/routes/a.tsx
  • e2e/solid-start/virtual-routes/src/routes/b.tsx
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • e2e/solid-start/virtual-routes/package.json
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: TanStack/router#0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to e2e/** : Store end-to-end tests under the e2e/ directory
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
PR: TanStack/router#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:

  • e2e/solid-start/virtual-routes/src/routeTree.gen.ts
🧬 Code graph analysis (19)
e2e/solid-start/virtual-routes/src/utils/seo.ts (1)
examples/solid/start-basic/src/utils/seo.ts (1)
  • title (1-33)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx (3)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx (1)
  • Route (3-27)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/home.tsx (1)
e2e/solid-start/virtual-routes/src/routes/root.tsx (1)
  • Route (13-28)
e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx (3)
e2e/solid-start/virtual-routes/src/routes/a.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/b.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx (3)
e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx (1)
  • Route (5-12)
e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/posts.tsx (1)
  • fetchPosts (32-38)
e2e/solid-start/virtual-routes/tests/setup/global.teardown.ts (6)
e2e/solid-router/basic-file-based/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/solid-router/basic-solid-query/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/solid-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/solid-router/basic-solid-query-file-based/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/solid-router/basic-virtual-file-based/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/solid-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx (3)
e2e/solid-start/virtual-routes/src/routes/a.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/b.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx (3)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/tests/setup/global.setup.ts (1)
scripts/set-ts-version.js (1)
  • packageJson (33-33)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx (3)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx (1)
  • Route (3-27)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx (1)
e2e/solid-start/virtual-routes/src/posts.tsx (1)
  • fetchPost (16-30)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx (3)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx (1)
  • Route (3-27)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/root.tsx (12)
e2e/solid-start/virtual-routes/src/routes/a.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/b.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx (1)
  • Route (3-27)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/home.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx (1)
  • Route (5-12)
e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx (1)
  • Route (4-7)
e2e/solid-start/virtual-routes/src/posts.tsx (2)
e2e/solid-start/virtual-routes/src/utils/posts.tsx (3)
  • PostType (5-9)
  • fetchPost (17-33)
  • fetchPosts (35-42)
e2e/react-router/js-only-file-based/src/posts.js (1)
  • queryURL (5-5)
e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx (2)
e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx (1)
  • Route (5-12)
e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx (1)
  • Route (4-7)
e2e/solid-start/virtual-routes/src/routes/a.tsx (3)
e2e/solid-start/virtual-routes/src/routes/b.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routeTree.gen.ts (1)
e2e/solid-start/virtual-routes/src/router.tsx (1)
  • getRouter (4-12)
e2e/solid-start/virtual-routes/src/routes/b.tsx (3)
e2e/solid-start/virtual-routes/src/routes/a.tsx (1)
  • Route (3-7)
e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx (1)
  • Route (3-5)
e2e/solid-start/virtual-routes/src/utils/posts.tsx (1)
e2e/solid-start/virtual-routes/src/posts.tsx (3)
  • PostType (4-8)
  • fetchPost (16-30)
  • fetchPosts (32-38)
⏰ 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). (2)
  • GitHub Check: Test
  • GitHub Check: Preview
🔇 Additional comments (38)
e2e/solid-start/virtual-routes/.prettierignore (1)

1-4: LGTM!

The Prettier ignore patterns are appropriately configured for an e2e test suite: build outputs, static assets, lock files, and generated route trees are all reasonable exclusions. The patterns follow standard conventions and placement aligns with the e2e directory structure.

e2e/solid-start/virtual-routes/tsconfig.json (1)

1-24: Configuration looks good for Solid Start e2e testing.

The TypeScript configuration is well-structured for a Solid Start project running under Vite:

  • JSX settings (jsx: "preserve" + jsxImportSource: "solid-js") follow the Solid Start convention
  • moduleResolution: "Bundler" and ESNext modules are appropriate for Vite
  • noEmit: true is correct for a type-checking configuration in this context
  • Path alias (~/*./src/*) is standard for e2e test organization
e2e/solid-start/virtual-routes/public/site.webmanifest (1)

2-3: Populate empty name and short_name fields.

The PWA manifest defines empty strings for name and short_name, which means the installed app won't display a proper name when added to a device home screen or listed in app stores during e2e testing or manual verification.

Provide meaningful identifiers for the test application.

- "name": "",
- "short_name": "",
+ "name": "Solid Start Virtual Routes Test",
+ "short_name": "Virtual Routes",
⛔ Skipped due to learnings
Learnt from: hokkyss
PR: TanStack/router#5418
File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3
Timestamp: 2025-10-09T12:59:14.842Z
Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.
e2e/solid-start/virtual-routes/public/script.js (1)

1-2: LGTM! Appropriate test fixture for verifying script loading.

This simple script serves its purpose well as an e2e test fixture. The console log and global flag pattern allows tests to verify that the script loaded successfully.

e2e/solid-start/virtual-routes/public/script2.js (1)

1-2: LGTM! Consistent test fixture pattern.

This script follows the same pattern as script.js, enabling tests to verify that multiple independent scripts can be loaded correctly.

e2e/solid-start/virtual-routes/src/utils/seo.ts (2)

12-30: Implementation matches the established pattern.

The SEO utility correctly constructs meta tags for Twitter Card and Open Graph protocols. The conditional image tag handling is well-implemented using the spread operator.

Note: The hardcoded Twitter handles (@tannerlinsley) are appropriate for this e2e test context.


32-33: LGTM!

Clean return of the constructed tags array.

e2e/solid-start/virtual-routes/src/utils/users.tsx (1)

1-5: LGTM! Clean type definition.

The User type is well-defined with appropriate fields for e2e testing purposes.

e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/world.tsx (1)

1-5: LGTM!

Clean route definition following the file-based routing pattern consistently used across the subtree.

e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/index.tsx (1)

1-5: LGTM!

Proper index route implementation with the correct trailing slash in the route path.

e2e/solid-start/virtual-routes/.gitignore (1)

1-20: LGTM!

Comprehensive ignore patterns appropriate for a Solid Start e2e project with Playwright testing.

e2e/solid-start/virtual-routes/src/routes/home.tsx (1)

1-13: LGTM!

Simple and clean root route implementation. The component definition follows the route export appropriately.

e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/universe.tsx (1)

1-5: LGTM!

Consistent route definition following the established pattern in the hello subtree.

e2e/solid-start/virtual-routes/src/routes/a.tsx (1)

1-11: LGTM!

Proper use of layout route segments (underscore-prefixed paths) for nested layouts. Implementation is clean and consistent with the sibling route at layout-b.

e2e/solid-start/virtual-routes/package.json (1)

1-9: LGTM!

Package configuration follows best practices:

  • Correct use of workspace:^ protocol for internal dependencies (as per coding guidelines)
  • Appropriate dev and build scripts
  • Reasonable dependency versions for an e2e test suite

Also applies to: 11-37

e2e/solid-start/virtual-routes/src/posts.tsx (3)

1-8: LGTM!

Clean type definition and imports for the data fetching utilities.


18-18: Artificial delays are appropriate for e2e testing.

The 500ms delays help simulate real network latency in the test environment, which is a good practice for realistic e2e tests.

Also applies to: 34-34


12-14: No issues found—environment variable is correctly configured.

The code checks VITE_NODE_ENV, which is a custom environment variable properly prefixed with VITE_ to ensure Vite exposes it at import.meta.env. Verification confirms this variable is explicitly set in all playwright configuration files throughout the e2e test suite (e.g., e2e/solid-start/basic/playwright.config.ts and similar), ensuring consistent test environment detection across all projects.

e2e/solid-start/virtual-routes/tests/app.spec.ts (1)

1-33: LGTM! Well-structured e2e test suite.

The test suite comprehensively covers the core navigation scenarios for virtual routes including post navigation, nested layouts, and not-found handling. The tests use semantic selectors and follow Playwright best practices.

e2e/solid-start/virtual-routes/src/routes/layout/first-layout.tsx (1)

1-16: LGTM! Correctly implements file-based layout route.

The layout route is properly configured with an Outlet for nested route rendering, following the established pattern for TanStack Router file-based routes.

e2e/solid-start/virtual-routes/postcss.config.mjs (1)

1-6: LGTM! Standard PostCSS configuration.

The configuration correctly sets up Tailwind CSS and Autoprefixer for the e2e test application.

e2e/solid-start/virtual-routes/src/styles/app.css (1)

1-22: LGTM! Standard Tailwind CSS setup.

The stylesheet properly configures Tailwind with base styles for light/dark mode support. The .using-mouse utility appropriately handles focus outline removal for mouse interactions.

e2e/solid-start/virtual-routes/src/router.tsx (1)

1-12: LGTM! Clean router factory function.

The getRouter function correctly initializes a TanStack Solid Router with appropriate configuration (intent-based preloading and scroll restoration).

e2e/solid-start/virtual-routes/src/routes/posts/posts-home.tsx (1)

1-9: LGTM! Correctly implements posts index route.

The route definition follows the file-based routing pattern and provides an appropriate index component for the posts section.

e2e/solid-start/virtual-routes/src/routes/b.tsx (1)

1-11: LGTM! Correctly implements layout-b route.

The route definition follows the established pattern for nested layouts and is consistent with the parallel layout-a implementation.

e2e/solid-start/virtual-routes/tests/setup/global.teardown.ts (1)

1-6: LGTM! Follows established teardown pattern.

The teardown function correctly mirrors the pattern used across other e2e test suites in the repository, ensuring proper cleanup of the test server.

e2e/solid-start/virtual-routes/vite.config.ts (1)

1-21: LGTM!

The Vite configuration is properly set up for Solid Start with virtual routes. The plugin order and configuration options are correct.

e2e/solid-start/virtual-routes/tailwind.config.mjs (1)

1-4: LGTM!

The Tailwind configuration is correctly set up with appropriate content paths for the Solid Start application.

e2e/solid-start/virtual-routes/src/routes/file-based-subtree/hello/route.tsx (1)

1-27: LGTM!

The route component is well-structured with proper navigation links and outlet for nested routes. The use of activeProps for visual feedback is appropriate.

e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx (2)

14-16: LGTM!

The error component correctly delegates to the base ErrorComponent with proper typing.


18-27: LGTM!

The component correctly uses the route loader data and renders the post content with appropriate styling.

e2e/solid-start/virtual-routes/src/routes/root.tsx (3)

13-28: LGTM!

The root route configuration is properly structured with appropriate not-found handling and stylesheet injection via the head function.


30-36: LGTM!

The root component cleanly wraps the document structure with the router outlet.


38-97: LGTM!

The root document structure is comprehensive with proper navigation, error handling, and developer tools. The intentional @ts-expect-error on line 80 correctly tests 404 behavior for non-existent routes.

e2e/solid-start/virtual-routes/src/routes/layout/second-layout.tsx (1)

1-34: LGTM!

The nested layout component is correctly structured with navigation links and an outlet for rendering child routes. The use of activeProps provides appropriate visual feedback.

e2e/solid-start/virtual-routes/routes.ts (1)

1-24: LGTM!

The virtual route tree is well-structured and comprehensive, covering:

  • Index and posts routes with dynamic parameters
  • Multi-level nested layouts
  • Physical file-based subtree

The declarative route definition is clean and follows the virtual-file-routes API correctly.

e2e/solid-start/virtual-routes/tests/setup/global.setup.ts (1)

2-2: Import path verified—no issues found.

The import path ../../package.json correctly resolves to e2e/solid-start/virtual-routes/package.json, the file exists, and contains the expected name property (tanstack-solid-start-e2e-virtual-routes).

e2e/solid-start/virtual-routes/playwright.config.ts (1)

8-10: Confirm top‑level await support

Config uses TLA. Ensure Node runtime for Playwright is ≥18 and ESM/TS setup supports it; otherwise compute ports inside helper and import the resolved values.

"dev": "vite dev --port 3000",
"dev:e2e": "vite dev",
"build": "vite build && tsc --noEmit",
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
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 the relative path in the start script.

The start script references ../client which seems unusual. Ensure this path correctly points to the client output directory for the production server.


🏁 Script executed:

#!/bin/bash
# Verify the directory structure and whether ../client exists or is created during build
fd -t d "client" e2e/solid-start/virtual-routes

Length of output: 0


🏁 Script executed:

#!/bin/bash
# List full directory structure under e2e/solid-start/virtual-routes
echo "=== Full directory structure ==="
find e2e/solid-start/virtual-routes -type d | head -20

echo ""
echo "=== Files in e2e/solid-start/virtual-routes ==="
find e2e/solid-start/virtual-routes -maxdepth 2 -type f | head -20

echo ""
echo "=== Check parent directory e2e/solid-start ==="
find e2e/solid-start -maxdepth 2 -type d

echo ""
echo "=== Content of package.json ==="
cat e2e/solid-start/virtual-routes/package.json

Length of output: 4311


🏁 Script executed:

#!/bin/bash
# Check other e2e projects' start scripts for patterns
echo "=== Checking start scripts in other e2e projects ==="
rg -n '"start"' e2e/solid-start/*/package.json -A1 -B1

echo ""
echo "=== Check if there's a vite config or tsconfig ==="
find e2e/solid-start/virtual-routes -maxdepth 1 -name "vite.config.*" -o -name "tsconfig.*" -o -name "solid.config.*" | xargs ls -la 2>/dev/null

echo ""
echo "=== Look for any client build output references ==="
rg -i "client" e2e/solid-start/virtual-routes/ --type ts --type js -n

Length of output: 4234


🏁 Script executed:

#!/bin/bash
# Check the vite config to understand build output structure
echo "=== Content of vite.config.ts ==="
cat e2e/solid-start/virtual-routes/vite.config.ts

echo ""
echo "=== Check what files are generated after build ==="
grep -r "outDir\|build" e2e/solid-start/virtual-routes/vite.config.ts

Length of output: 553






🌐 Web query:

srvx npm package --prod -s flag documentation

💡 Result:

Do you want the meaning/behavior of the --prod and -s flags for the srvx CLI, or examples of how to run them? I can look up the official docs and quote the CLI help—tell me which and I’ll fetch the exact docs.


🌐 Web query:

Solid Start build output directory structure dist/client

💡 Result:

dist/client is the client-side output of a Solid Start (Vite-based) build — it contains the static assets the browser needs: bundled JS/CSS for hydration, chunk files, asset files (images/fonts), and the Vite-generated client manifest/ssr-manifest used by server rendering. The server-side build (dist/server) contains the SSR/server bundle (handler) that imports the client manifest to emit correct asset tags and preload hints. In short:

  • dist/client — browser assets (bundles, .vite folder, assets, css, js, manifest). [1][2]
  • dist/server — server bundle/entry that performs SSR and references dist/client assets at runtime. [1][2]

Sources: Solid Start repo/docs (build layout and tooling), Vite SSR docs on client/server builds and ssr-manifest. [1][2][3]

References
[1] solidjs/solid-start (GitHub). (github.com)
[2] Vite — Server-Side Rendering / client+server build details (ssr-manifest). (v2.vitejs.dev)
[3] Solid Start "use server" / docs (shows server/client model in Solid Start). (docs.solidjs.com)

Citations:


🌐 Web query:

srvx CLI help documentation static files directory

💡 Result:

Do you mean:

  • the filesystem path where the srvx CLI stores its built-in help/static docs, or
  • how to serve a static files directory with the srvx CLI, or
  • where the srvx project’s documentation/static site lives (repo or site)?

Which one do you want?


🏁 Script executed:

#!/bin/bash
# Search for any build scripts or monorepo configuration that might create ../client
echo "=== Check root package.json or monorepo config ==="
find . -maxdepth 2 -name "package.json" -type f | head -3 | xargs grep -l "workspaces\|build" 2>/dev/null | head -1 | xargs cat | head -50

echo ""
echo "=== Search for ../client references in build or config files ==="
rg -l "\.\./client" --type json --type ts --type js e2e/ | head -10

echo ""
echo "=== Check if there are any symlinks or shared directories ==="
find e2e/solid-start -maxdepth 1 -type l 2>/dev/null

Length of output: 3030


Correct the start script to reference the actual client build output directory.

The ../client path does not exist in the repository. Solid Start builds client assets to dist/client during the build process. The srvx command's -s flag should reference this directory to serve static files correctly.

Change:

"start": "pnpx srvx --prod -s ../client  dist/server/server.js",

To:

"start": "pnpx srvx --prod -s dist/client  dist/server/server.js",

This issue appears consistently across multiple Solid Start and React Start e2e projects, so the same fix should be applied to all affected projects.

🤖 Prompt for AI Agents
In e2e/solid-start/virtual-routes/package.json around line 10, the "start"
script uses "-s ../client" which points to a nonexistent path; update the static
serve path to the actual Solid Start client build output "dist/client" so the
srvx command becomes "pnpx srvx --prod -s dist/client dist/server/server.js";
apply the same change to other Solid Start and React Start e2e project
package.json files that use "../client".

Comment on lines +22 to +27
.catch((err) => {
if (err.status === 404) {
throw notFound()
}
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 the error property for redaxios.

The error handling checks err.status, but axios-like libraries typically expose the status code at err.response.status. Please verify that redaxios uses err.status directly and not the nested err.response.status property.


🌐 Web query:

redaxios error object structure and status code property

💡 Result:

Short answer: redaxios follows the Axios API for errors — the HTTP status code is on error.response.status (not error.status). The error object otherwise looks like a standard AxiosError (message, name, stack, config, code, request, response). Use optional chaining to be safe: const status = error.response?.status.

Sources: redaxios package README (axios-compatible wrapper). [1] Axios error handling / AxiosError shape (shows error.response.status). [2]

References
[1] redaxios package (axios-compatible, uses fetch).
[2] axios docs — error/response handling (error.response.status).


Fix the error property access for redaxios in the error handler.

The code checks err.status, but redaxios follows the Axios API where the HTTP status code is at err.response.status. Change line 23 to if (err.response?.status === 404) to properly access the nested status property.

🤖 Prompt for AI Agents
In e2e/solid-start/virtual-routes/src/posts.tsx around lines 22 to 27, the error
handler checks err.status but redaxios follows Axios semantics and places the
HTTP status on err.response.status; update the condition to check
err.response?.status === 404 (use optional chaining to avoid undefined) so the
404 case triggers correctly, and leave the rest of the catch logic unchanged.


export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params: { postId } }) => fetchPost(postId),
errorComponent: PostErrorComponent as any,
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

Remove the as any type assertion for proper type safety.

The as any cast bypasses TypeScript's type checking, which violates the strict type safety requirement. This could hide type incompatibilities between PostErrorComponent and the expected error component signature.

As per coding guidelines: "Use TypeScript in strict mode with extensive type safety across the codebase"

Consider removing the cast and ensuring PostErrorComponent matches the expected type:

-  errorComponent: PostErrorComponent as any,
+  errorComponent: PostErrorComponent,

If there's a type mismatch, please fix the component's signature rather than using a type assertion.

📝 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
errorComponent: PostErrorComponent as any,
errorComponent: PostErrorComponent,
🤖 Prompt for AI Agents
In e2e/solid-start/virtual-routes/src/routes/posts/posts-detail.tsx around line
7, remove the "as any" type assertion on errorComponent and make
PostErrorComponent conform to the framework's expected error component type
instead: update the component's props signature to match the expected
ErrorComponent/ErrorBoundary props (error, reset or whatever the route type
requires) or explicitly type it with the correct imported ErrorComponent type,
then pass PostErrorComponent without any cast; do not use any, adjust
exports/imports and prop handling to satisfy the expected type.

@@ -0,0 +1,38 @@
import { Link, Outlet, createFileRoute } from '@tanstack/solid-router'
import { fetchPosts } from '../../posts'
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

Fix import path to utils module

The utilities live under src/utils; this import likely points to a non-existent/old file.

Apply:

-import { fetchPosts } from '../../posts'
+import { fetchPosts } from '../../utils/posts'

Run to confirm only utils exports fetchPosts:


🏁 Script executed:

#!/bin/bash
fd -a 'posts.tsx' e2e/solid-start/virtual-routes/src | nl -ba
echo '--- grep for fetchPosts exports'
rg -nP --type tsx -C2 'export\s+const\s+fetchPosts\b' e2e/solid-start/virtual-routes/src

Length of output: 100


🏁 Script executed:

#!/bin/bash
# Find posts.tsx files
echo "=== Finding posts.tsx files ==="
fd -a 'posts\.tsx' e2e/solid-start/virtual-routes/src

echo ""
echo "=== Checking directory structure under src ==="
fd -a -t d . e2e/solid-start/virtual-routes/src --max-depth 3

echo ""
echo "=== Looking for posts exports in utils ==="
rg -n 'export.*fetchPosts' e2e/solid-start/virtual-routes/src --type ts --type js

echo ""
echo "=== Current import in target file ==="
head -5 e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx

Length of output: 1258


🏁 Script executed:

#!/bin/bash
echo "=== Content of src/posts.tsx ==="
cat e2e/solid-start/virtual-routes/src/posts.tsx

echo ""
echo "=== Content of src/utils/posts.tsx ==="
cat e2e/solid-start/virtual-routes/src/utils/posts.tsx

Length of output: 2108


Fix import path to utils module

The current import uses the plain async function from src/posts.tsx, but route loaders in Solid Start require createServerFn wrappers for proper server-side execution. The correct implementation is in src/utils/posts.tsx.

-import { fetchPosts } from '../../posts'
+import { fetchPosts } from '../../utils/posts'
📝 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
import { fetchPosts } from '../../posts'
import { fetchPosts } from '../../utils/posts'
🤖 Prompt for AI Agents
In e2e/solid-start/virtual-routes/src/routes/posts/posts.tsx around line 2, the
file imports fetchPosts from '../../posts' which points to a plain async
function; route loaders need the createServerFn-wrapped implementation. Update
the import to point to '../../utils/posts' (the module that exports the
createServerFn-wrapped fetchPosts) and ensure you import the wrapped function
name exported there so the route loader executes on the server correctly.

Comment on lines +24 to +30
.catch((err) => {
console.error(err)
if (err.status === 404) {
throw notFound()
}
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

404 handling for axios/redaxios errors is incorrect

err.status is often undefined; use response?.status fallback to detect 404 and return notFound().

-      .catch((err) => {
-        console.error(err)
-        if (err.status === 404) {
-          throw notFound()
-        }
-        throw err
-      })
+      .catch((err: any) => {
+        console.error(err)
+        const status = err?.response?.status ?? err?.status
+        if (status === 404) {
+          throw notFound()
+        }
+        throw err
+      })
📝 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
.catch((err) => {
console.error(err)
if (err.status === 404) {
throw notFound()
}
throw err
})
.catch((err: any) => {
console.error(err)
const status = err?.response?.status ?? err?.status
if (status === 404) {
throw notFound()
}
throw err
})
🤖 Prompt for AI Agents
In e2e/solid-start/virtual-routes/src/utils/posts.tsx around lines 24 to 30, the
error handling checks err.status which is often undefined for axios/redaxios
errors; update the catch to inspect err.response?.status (falling back to
err.status) and throw notFound() when that value is 404, e.g. compute const
status = err?.response?.status ?? err?.status and if (status === 404) throw
notFound(); otherwise rethrow the error (you can still console.error(err) before
the check).

Comment on lines +7 to +9
const PORT = process.env.VITE_SERVER_PORT || 3000

export const DEPLOY_URL = `http://localhost:${PORT}`
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 environment variable access pattern for the runtime context.

Using process.env.VITE_SERVER_PORT may cause issues depending on where this code executes:

  • Client-side (browser): Vite exposes env vars via import.meta.env.VITE_SERVER_PORT, not process.env. Using process.env would result in undefined (or an error if process is not polyfilled).
  • Server-side (Node.js): process.env is correct.

Since this utility is in src/utils/ with a .tsx extension, it might run in both contexts. Please verify the execution context and ensure the correct env access pattern is used.

If this code runs client-side, apply this diff:

-const PORT = process.env.VITE_SERVER_PORT || 3000
+const PORT = import.meta.env.VITE_SERVER_PORT || 3000

Or run this script to check where users.tsx is imported:


🏁 Script executed:

#!/bin/bash
# Description: Find all imports of users.tsx to determine runtime context

rg -n --type=ts --type=tsx -C3 "from ['\"].*users['\"]|import.*users"

Length of output: 27


Now let me search for where this file is used in the codebase:<!-- [scratchpad_update]
[task verify_env_vars_1/1]
Web search on Solid Start architecture complete. Key findings:

  • Solid Start is SSR by default (runs on both server and client)
  • Utilities in src/utils/ are shared across server and client
  • Code can run in both contexts (isomorphic code)
  • Need to verify where users.tsx imports happen

[observations]

  • This is an E2E test directory (e2e/solid-start/...) not main source
  • E2E tests typically run separately from main app code
  • File location: e2e/solid-start/virtual-routes/src/utils/users.tsx
  • DEPLOY_URL likely used in E2E tests (for testing endpoints)
  • VITE_SERVER_PORT has VITE_ prefix so it can be accessed via import.meta.env

[pending]

  • Search codebase for actual imports/usage of users.tsx
  • Check if it's used in server routes or client components
  • Verify if E2E tests run in Node.js or browser context

[actions]

  1. Run shell script to find imports of users.tsx
  2. Check content of users.tsx to see how DEPLOY_URL is used
  3. Determine correct execution context based on usage
    [scratchpad_end] -->

Let me search the codebase directly to find where users.tsx is imported and how it's used:<!-- [scratchpad_update]
[task verify_env_vars_1/1]
Web searches confirm E2E test patterns - need to check the actual codebase

[observations from latest web search]

  • E2E tests run in browser context (Cypress, Playwright, etc.), not Node.js server
  • Browser context: import.meta.env is available (Vite handles it)
  • E2E tests can use Vite via preprocessors/plugins
  • Cypress E2E: loads page via browser, environment variables are accessible via import.meta.env
  • Playwright: runs tests in browser context
  • Key point: E2E tests that run in browser need import.meta.env, not process.env
  • Process.env is Node.js only, doesn't exist in browser

[critical insight]

  • File location: e2e/ → indicates E2E tests
  • If users.tsx is imported in E2E test → browser context → must use import.meta.env
  • If DEPLOY_URL is used to call test endpoints from browser → import.meta.env is needed
  • Current code uses process.env which would be undefined in browser

[pending]

  • Must find actual imports/usage of users.tsx in codebase
  • Confirm if E2E tests actually import this file

[actions]

  1. Run scripts to find all usages of users.tsx, DEPLOY_URL, PORT
  2. Check if it's imported in e2e test files
  3. Determine execution context conclusively
    [scratchpad_end] -->

Let me run scripts directly on the codebase to find where users.tsx is used and in what context:


---

🏁 Script executed:

```shell
#!/bin/bash
# Search for all usages of DEPLOY_URL and PORT in the e2e directory
echo "=== Searching for DEPLOY_URL usage ==="
fd -t f --extension tsx --extension ts --extension js "e2e" | head -20
find e2e -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.js" \) | head -20

echo "=== Searching for imports of users.tsx ==="
find e2e -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.js" \) -exec grep -l "users\|DEPLOY_URL\|PORT" {} \;

echo "=== Content of users.tsx ==="
find . -path "*/e2e/*/src/utils/users.tsx" -exec cat {} \;

Length of output: 13010


Update the environment variable access to support client-side code execution.

The file under review uses process.env.VITE_SERVER_PORT, which is incorrect for client-side code. However, analysis of the codebase shows other similar E2E test files (e.g., e2e/react-start/basic/src/utils/users.tsx, e2e/solid-start/basic-solid-query/src/utils/users.tsx) successfully use the dual-fallback pattern:

-const PORT = process.env.VITE_SERVER_PORT || 3000
+const PORT = import.meta.env.VITE_SERVER_PORT || process.env.VITE_SERVER_PORT || 3000

This fallback chain correctly handles both browser (where Vite exposes env vars via import.meta.env) and server contexts.

📝 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
const PORT = process.env.VITE_SERVER_PORT || 3000
export const DEPLOY_URL = `http://localhost:${PORT}`
const PORT = import.meta.env.VITE_SERVER_PORT || process.env.VITE_SERVER_PORT || 3000
export const DEPLOY_URL = `http://localhost:${PORT}`
🤖 Prompt for AI Agents
In e2e/solid-start/virtual-routes/src/utils/users.tsx around lines 7 to 9,
replace the direct use of process.env.VITE_SERVER_PORT with the dual-fallback
pattern that supports both client and server: read
import.meta.env.VITE_SERVER_PORT first (for browser/Vite), then fallback to
process.env.VITE_SERVER_PORT, and finally default to 3000; update the PORT
constant and DEPLOY_URL to use that resolved value so client-side builds work
correctly.

@birkskyum birkskyum merged commit 410fdf8 into main Oct 20, 2025
6 checks passed
@birkskyum birkskyum deleted the solid-start-virtual-routes-e2e branch October 20, 2025 23:36
@birkskyum birkskyum added this to the catch up solid to react milestone Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants