Skip to content

fix(router-core): don't set isServer if NODE_ENV test - #6727

Merged
schiller-manuel merged 2 commits into
mainfrom
isServer-test-undefined
Feb 21, 2026
Merged

fix(router-core): don't set isServer if NODE_ENV test#6727
schiller-manuel merged 2 commits into
mainfrom
isServer-test-undefined

Conversation

@schiller-manuel

@schiller-manuelschiller-manuel commented Feb 21, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Server-side detection now correctly returns undefined in test environments instead of always returning a fixed value, improving test accuracy.

@coderabbitai

coderabbitaiBot commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The isServer export in packages/router-core/src/isServer/server.ts is modified from a constant boolean to a conditional value that evaluates to true in non-test environments and undefined when NODE_ENV is 'test', introducing environment-aware behavior.

Changes

Cohort / File(s)Summary
Environment-aware isServer detection
packages/router-core/src/isServer/server.ts
Changed isServer from a fixed boolean constant to a conditional expression that returns true or undefined based on NODE_ENV, enabling test-specific behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • Sheraff

Poem

🐰 A little bunny hops with glee,
Testing truthfully, setting servers free!
When NODE_ENV says "test," undefined flows,
But truth remains where production goes. ✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch isServer-test-undefined

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

@nx-cloud

nx-cloudBot commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit cc299f7

CommandStatusDurationResult
nx run tanstack-router-e2e-bundle-size:build --...✅ Succeeded1m 25sView ↗

☁️ Nx Cloud last updated this comment at 2026-02-21 21:58:21 UTC

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: a21eab71136a
  • Measured at: 2026-02-21T21:44:29.663Z
  • Baseline source: history:996e18284413
  • Dashboard: bundle-size history
ScenarioCurrent (gzip)Delta vs baselineRawBrotliTrend
react-router.minimal86.76 KiB0 B (0.00%)272.72 KiB75.41 KiB▅▅▅
react-router.full89.85 KiB0 B (0.00%)283.19 KiB78.06 KiB▅▅▅
solid-router.minimal36.04 KiB0 B (0.00%)107.87 KiB32.43 KiB▅▅▅
solid-router.full40.39 KiB0 B (0.00%)120.96 KiB36.25 KiB▅▅▅
vue-router.minimal51.90 KiB0 B (0.00%)147.86 KiB46.62 KiB▅▅▅
vue-router.full56.76 KiB0 B (0.00%)163.47 KiB50.98 KiB▅▅▅
react-start.minimal99.25 KiB0 B (0.00%)311.71 KiB85.93 KiB▅▅▅
react-start.full102.66 KiB0 B (0.00%)321.63 KiB88.71 KiB▅▅▅
solid-start.minimal48.28 KiB0 B (0.00%)145.30 KiB42.70 KiB▅▅▅
solid-start.full53.76 KiB0 B (0.00%)161.25 KiB47.34 KiB▅▅▅

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@pkg-pr-new

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@6727

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router@6727

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6727

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: cc299f7

@schiller-manuel
schiller-manuel merged commit fdb8d2e into mainFeb 21, 2026
7 of 8 checks passed
@schiller-manuel
schiller-manuel deleted the isServer-test-undefined branch February 21, 2026 21:47
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@schiller-manuel