Repository navigation
fix: dev style with non runnable dev environments and basepath support #6348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
e0ad796
51470d5
c4720b2
4064388
050fda7
53f8a89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { defineConfig } from 'vite' | ||
| import tsConfigPaths from 'vite-tsconfig-paths' | ||
| import { cloudflare } from '@cloudflare/vite-plugin' | ||
| import { tanstackStart } from '@tanstack/react-start/plugin/vite' | ||
| import viteReact from '@vitejs/plugin-react' | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [ | ||
| tsConfigPaths({ | ||
| projects: ['./tsconfig.json'], | ||
| }), | ||
| cloudflare({ viteEnvironment: { name: 'ssr' }, inspectorPort: false }), | ||
| tanstackStart(), | ||
| viteReact(), | ||
| ], | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "$schema": "node_modules/wrangler/config-schema.json", | ||
| "name": "tanstack-start-css-modules", | ||
| "compatibility_date": "2025-09-24", | ||
| "compatibility_flags": ["nodejs_compat"], | ||
| "main": "@tanstack/react-start/server-entry", | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -370,7 +370,7 @@ test.describe('server function sets cookies', () => { | |||||||||||||||
| test.describe('server functions with async validation', () => { | ||||||||||||||||
| test.use({ | ||||||||||||||||
| whitelistErrors: [ | ||||||||||||||||
| /Failed to load resource: the server responded with a status of 500/, | ||||||||||||||||
| 'Failed to load resource: the server responded with a status of 500', | ||||||||||||||||
| ], | ||||||||||||||||
| }) | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -739,7 +739,7 @@ test('redirect via server function with middleware does not cause serialization | |||||||||||||||
|
|
||||||||||||||||
| test.describe('unhandled exception in middleware (issue #5266)', () => { | ||||||||||||||||
| // Whitelist the expected 500 error since this test verifies error handling | ||||||||||||||||
| test.use({ whitelistErrors: [/500/] }) | ||||||||||||||||
| test.use({ whitelistErrors: ['500'] }) | ||||||||||||||||
|
Comment on lines
740
to
+742
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whitelist string '500' is too generic and may match unintended errors. The string Consider using a more specific pattern consistent with line 373. 🔍 Suggested fix- test.use({ whitelistErrors: ['500'] })
+ test.use({ whitelistErrors: ['Failed to load resource: the server responded with a status of 500'] })📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| test('does not crash server and shows error component', async ({ page }) => { | ||||||||||||||||
| // This test verifies that when a middleware throws an unhandled exception, | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: TanStack/router
Length of output: 1735
🏁 Script executed:
Repository: TanStack/router
Length of output: 2276
Ensure
VITE_CONFIGenvironment variable is propagated towebServer.envfor explicit contract clarity.The baseURL and devCommand are both derived from
process.env.VITE_CONFIG(lines 12, 16), creating an implicit contract that callers must setVITE_CONFIGconsistently. However,VITE_CONFIGis not passed towebServer.env(lines 35–37), making this contract invisible to the spawned dev server. AddVITE_CONFIGtowebServer.envto clarify the dependency and prevent accidental misconfiguration when running locally:webServer.env block (lines 35–37)
🤖 Prompt for AI Agents