Repository: TanStack/router (ts)

Issue:
No typescipt error thrown if context is missing
### Describe the bug

No typescipt error thrown if context is missing from createRouter args.

### Your Example Website or App

https://stackblitz.com/edit/tanstack-router-pte2gy

### Steps to Reproduce the Bug or Issue

Create a root route with a context with required prop
Create a router without specifying the context object
No typescript error is thrown

### Expected behavior

Typescript error should be thrown. The app should fail to compile a prod build.

### Screenshots or Videos

_No response_

### Platform

- OS: any
- Browser: any
- Version: any


### Additional context

_No response_
Context type inference on createRouter is not working anymore
### Describe the bug

When creating a new router with createRouter and a context value, the returned router doesn't contain valid typing on the options.context properties. This was working in version 1.34.5 but doesn't work anymore in version 1.44.2 (I did not test versions in between).

### Your Example Website or App

https://stackblitz.com/edit/github-dysjpq?file=src%2Fmain.tsx

### Steps to Reproduce the Bug or Issue

```tsx
import ReactDOM from 'react-dom/client';
import { RouterProvider, createRouter } from '@tanstack/react-router';
import { routeTree } from './routeTree.gen';

// Set up a Router instance
const router = createRouter({
  routeTree,
  defaultPreload: 'intent',
  context: {
    value: 'test',
  },
});

// Type inference is not working there (Property 'value' does not exist on type 'AnyContext'.)
const value = router.options.context.value;
```

### Expected behavior

Type inference on `router.options.context.value` should be inferred correctly.

### Screenshots or Videos

_No response_

### Platform

- OS: Windows
- Browser: Chrome


### Additional context

_No response_

Pull request:
fix(react-router): when children are added to the route tree, the inference of RouterContext is lost
When `addChildren` was called, we lost the type of `RootRoute` and there could no longer infer `RouterContext`.

Fixes #1943 
Fixes #1926


Patch:
diff --git a/examples/react/authenticated-routes/package.json b/examples/react/authenticated-routes/package.json
index 9765a050b..3c75137ed 100644
--- a/examples/react/authenticated-routes/package.json
+++ b/examples/react/authenticated-routes/package.json
@@ -9,9 +9,9 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-default-search-params/package.json b/examples/react/basic-default-search-params/package.json
index 2c50a2ec0..12e926bc4 100644
--- a/examples/react/basic-default-search-params/package.json
+++ b/examples/react/basic-default-search-params/package.json
@@ -10,8 +10,8 @@
   },
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-file-based-codesplitting/package.json b/examples/react/basic-file-based-codesplitting/package.json
index c298ed419..73ac678c6 100644
--- a/examples/react/basic-file-based-codesplitting/package.json
+++ b/examples/react/basic-file-based-codesplitting/package.json
@@ -9,9 +9,9 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-file-based/package.json b/examples/react/basic-file-based/package.json
index d78c792f6..2f1638483 100644
--- a/examples/react/basic-file-based/package.json
+++ b/examples/react/basic-file-based/package.json
@@ -9,9 +9,9 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-react-query-file-based/package.json b/examples/react/basic-react-query-file-based/package.json
index a2d676893..93a89293d 100644
--- a/examples/react/basic-react-query-file-based/package.json
+++ b/examples/react/basic-react-query-file-based/package.json
@@ -11,9 +11,9 @@
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
     "@tanstack/react-query-devtools": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-react-query/package.json b/examples/react/basic-react-query/package.json
index dba4cae3e..a84915390 100644
--- a/examples/react/basic-react-query/package.json
+++ b/examples/react/basic-react-query/package.json
@@ -11,8 +11,8 @@
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
     "@tanstack/react-query-devtools": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
diff --git a/examples/react/basic-ssr-file-based/package.json b/examples/react/basic-ssr-file-based/package.json
index 98851eec3..be6a05639 100644
--- a/examples/react/basic-ssr-file-based/package.json
+++ b/examples/react/basic-ssr-file-based/package.json
@@ -11,10 +11,10 @@
     "debug": "node --inspect-brk server"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
+    "@tanstack/start": "^1.44.4",
     "get-port": "^7.1.0",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic-ssr-streaming-file-based/package.json b/examples/react/basic-ssr-streaming-file-based/package.json
index 4102e457b..3ed60784e 100644
--- a/examples/react/basic-ssr-streaming-file-based/package.json
+++ b/examples/react/basic-ssr-streaming-file-based/package.json
@@ -11,10 +11,10 @@
     "debug": "node --inspect-brk server"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
+    "@tanstack/start": "^1.44.4",
     "get-port": "^7.1.0",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/basic/package.json b/examples/react/basic/package.json
index e70287d62..b221a33c1 100644
--- a/examples/react/basic/package.json
+++ b/examples/react/basic/package.json
@@ -10,8 +10,8 @@
   },
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
diff --git a/examples/react/deferred-data/package.json b/examples/react/deferred-data/package.json
index 250a50e59..89cd1fe89 100644
--- a/examples/react/deferred-data/package.json
+++ b/examples/react/deferred-data/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/kitchen-sink-file-based/package.json b/examples/react/kitchen-sink-file-based/package.json
index e16901a9d..d6a898419 100644
--- a/examples/react/kitchen-sink-file-based/package.json
+++ b/examples/react/kitchen-sink-file-based/package.json
@@ -9,9 +9,9 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/kitchen-sink-react-query-file-based/package.json b/examples/react/kitchen-sink-react-query-file-based/package.json
index 7b2acdeed..6eeb045cd 100644
--- a/examples/react/kitchen-sink-react-query-file-based/package.json
+++ b/examples/react/kitchen-sink-react-query-file-based/package.json
@@ -11,9 +11,9 @@
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
     "@tanstack/react-query-devtools": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/kitchen-sink-react-query/package.json b/examples/react/kitchen-sink-react-query/package.json
index 992f01aaa..b8acf166a 100644
--- a/examples/react/kitchen-sink-react-query/package.json
+++ b/examples/react/kitchen-sink-react-query/package.json
@@ -11,8 +11,8 @@
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
     "@tanstack/react-query-devtools": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/kitchen-sink/package.json b/examples/react/kitchen-sink/package.json
index f1b32d4eb..60e14e3ae 100644
--- a/examples/react/kitchen-sink/package.json
+++ b/examples/react/kitchen-sink/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "immer": "^10.1.1",
     "react": "^18.2.0",
diff --git a/examples/react/large-file-based/package.json b/examples/react/large-file-based/package.json
index bd5b1b7f6..354f32f81 100644
--- a/examples/react/large-file-based/package.json
+++ b/examples/react/large-file-based/package.json
@@ -12,9 +12,9 @@
   },
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/location-masking/package.json b/examples/react/location-masking/package.json
index 809ff30e9..8bcf0f339 100644
--- a/examples/react/location-masking/package.json
+++ b/examples/react/location-masking/package.json
@@ -11,8 +11,8 @@
   "dependencies": {
     "@radix-ui/react-dialog": "^1.1.1",
     "@tanstack/react-query": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
diff --git a/examples/react/navigation-blocking/package.json b/examples/react/navigation-blocking/package.json
index dce65bf8a..bbbadd536 100644
--- a/examples/react/navigation-blocking/package.json
+++ b/examples/react/navigation-blocking/package.json
@@ -10,8 +10,8 @@
   },
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
diff --git a/examples/react/quickstart-file-based/package.json b/examples/react/quickstart-file-based/package.json
index 21803c4a7..5d1e655ef 100644
--- a/examples/react/quickstart-file-based/package.json
+++ b/examples/react/quickstart-file-based/package.json
@@ -9,9 +9,9 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
     "immer": "^10.1.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/examples/react/quickstart-rspack-file-based/package.json b/examples/react/quickstart-rspack-file-based/package.json
index 8440d487b..852073877 100644
--- a/examples/react/quickstart-rspack-file-based/package.json
+++ b/examples/react/quickstart-rspack-file-based/package.json
@@ -8,15 +8,15 @@
     "preview": "rsbuild preview"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "react": "^18.3.1",
     "react-dom": "^18.3.1"
   },
   "devDependencies": {
     "@rsbuild/core": "^0.7.9",
     "@rsbuild/plugin-react": "^0.7.9",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/router-plugin": "^1.44.3",
     "@types/react": "^18.3.3",
     "@types/react-dom": "^18.3.0",
     "typescript": "^5.5.3"
diff --git a/examples/react/quickstart-webpack-file-based/package.json b/examples/react/quickstart-webpack-file-based/package.json
index 3b9a150d3..6f14f6ae2 100644
--- a/examples/react/quickstart-webpack-file-based/package.json
+++ b/examples/react/quickstart-webpack-file-based/package.json
@@ -7,14 +7,14 @@
     "build": "webpack build"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "react": "^18.3.1",
     "react-dom": "^18.3.1"
   },
   "devDependencies": {
     "@swc/core": "^1.6.13",
-    "@tanstack/router-plugin": "^1.44.2",
+    "@tanstack/router-plugin": "^1.44.3",
     "@types/react": "^18.3.3",
     "@types/react-dom": "^18.3.0",
     "html-webpack-plugin": "^5.6.0",
diff --git a/examples/react/quickstart/package.json b/examples/react/quickstart/package.json
index 1003338bd..09d50ddb2 100644
--- a/examples/react/quickstart/package.json
+++ b/examples/react/quickstart/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
   },
diff --git a/examples/react/scroll-restoration/package.json b/examples/react/scroll-restoration/package.json
index e73c71904..501fa244b 100644
--- a/examples/react/scroll-restoration/package.json
+++ b/examples/react/scroll-restoration/package.json
@@ -9,9 +9,9 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
     "@tanstack/react-virtual": "^3.8.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/router-devtools": "^1.44.4",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
   },
diff --git a/examples/react/start-basic-counter/package.json b/examples/react/start-basic-counter/package.json
index 6521eab93..2af0839e7 100644
--- a/examples/react/start-basic-counter/package.json
+++ b/examples/react/start-basic-counter/package.json
@@ -11,8 +11,8 @@
     "format": "prettier --write '**/*' --ignore-unknown"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/start": "^1.44.4",
     "@typescript-eslint/parser": "^7.16.0",
     "react": "^18.3.1",
     "react-dom": "^18.3.1",
diff --git a/examples/react/start-basic-react-query/package.json b/examples/react/start-basic-react-query/package.json
index 7b18ba87f..f45fb1491 100644
--- a/examples/react/start-basic-react-query/package.json
+++ b/examples/react/start-basic-react-query/package.json
@@ -15,11 +15,11 @@
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
     "@tanstack/react-query-devtools": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
     "@tanstack/react-router-with-query": "^1.43.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
+    "@tanstack/start": "^1.44.4",
     "@typescript-eslint/parser": "^7.16.0",
     "@vitejs/plugin-react": "^4.3.1",
     "dotenv": "^16.4.5",
diff --git a/examples/react/start-basic-rsc/package.json b/examples/react/start-basic-rsc/package.json
index 5add1e127..47084aca3 100644
--- a/examples/react/start-basic-rsc/package.json
+++ b/examples/react/start-basic-rsc/package.json
@@ -12,10 +12,10 @@
   },
   "dependencies": {
     "@babel/plugin-syntax-typescript": "^7.24.7",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
+    "@tanstack/start": "^1.44.4",
     "redaxios": "^0.5.1",
     "tailwind-merge": "^1.14.0",
     "vinxi": "0.3.12"
diff --git a/examples/react/start-basic/package.json b/examples/react/start-basic/package.json
index 0c3a1cb28..3a922e8c4 100644
--- a/examples/react/start-basic/package.json
+++ b/examples/react/start-basic/package.json
@@ -13,10 +13,10 @@
     "test:e2e:replay": "playwright test --project=replay-chromium"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
+    "@tanstack/start": "^1.44.4",
     "@typescript-eslint/parser": "^7.16.0",
     "@vitejs/plugin-react": "^4.3.1",
     "dotenv": "^16.4.5",
diff --git a/examples/react/start-trellaux/package.json b/examples/react/start-trellaux/package.json
index 30197d5b7..f6e6797d2 100644
--- a/examples/react/start-trellaux/package.json
+++ b/examples/react/start-trellaux/package.json
@@ -13,11 +13,11 @@
   "dependencies": {
     "@tanstack/react-query": "^5.50.1",
     "@tanstack/react-query-devtools": "^5.50.1",
-    "@tanstack/react-router": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
     "@tanstack/react-router-with-query": "^1.43.2",
-    "@tanstack/router-devtools": "^1.44.2",
-    "@tanstack/router-plugin": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/router-devtools": "^1.44.4",
+    "@tanstack/router-plugin": "^1.44.3",
+    "@tanstack/start": "^1.44.4",
     "@typescript-eslint/parser": "^7.16.0",
     "@vitejs/plugin-react": "^4.3.1",
     "isbot": "^5.1.12",
diff --git a/examples/react/wip-trpc-react-query/package.json b/examples/react/wip-trpc-react-query/package.json
index 0701e0865..92cf75ecf 100644
--- a/examples/react/wip-trpc-react-query/package.json
+++ b/examples/react/wip-trpc-react-query/package.json
@@ -13,8 +13,8 @@
   "dependencies": {
     "@tanstack/react-query": "^4.36.1",
     "@tanstack/react-query-devtools": "^4.36.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "@trpc/client": "^10.45.2",
     "@trpc/react-query": "^10.45.2",
     "@trpc/server": "^10.45.2",
diff --git a/examples/react/wip-waku-rsc/package.json b/examples/react/wip-waku-rsc/package.json
index 6e0c3c6b1..deee28ed2 100644
--- a/examples/react/wip-waku-rsc/package.json
+++ b/examples/react/wip-waku-rsc/package.json
@@ -9,8 +9,8 @@
   },
   "dependencies": {
     "@hono/node-server": "^1.12.0",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "hono": "^4.4.12",
     "react": "18.3.0-canary-0cdfef19b-20231211",
     "react-dom": "18.3.0-canary-0cdfef19b-20231211",
diff --git a/examples/react/wip-with-bling/package.json b/examples/react/wip-with-bling/package.json
index d7e7cff37..fa765c423 100644
--- a/examples/react/wip-with-bling/package.json
+++ b/examples/react/wip-with-bling/package.json
@@ -12,10 +12,10 @@
   },
   "dependencies": {
     "@tanstack/bling": "^0.5.0",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/start": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/start": "^1.44.4",
     "@tanstack/react-store": "^0.5.4",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "fastify": "^4.28.1",
     "get-port": "^7.1.0",
diff --git a/examples/react/wip-with-framer-motion/package.json b/examples/react/wip-with-framer-motion/package.json
index 1e25ef021..ab3b22d4e 100644
--- a/examples/react/wip-with-framer-motion/package.json
+++ b/examples/react/wip-with-framer-motion/package.json
@@ -9,8 +9,8 @@
     "start": "vite"
   },
   "dependencies": {
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "redaxios": "^0.5.1",
     "framer-motion": "^10.18.0",
     "immer": "^10.1.1",
diff --git a/examples/react/with-trpc/package.json b/examples/react/with-trpc/package.json
index 390f43bed..3abfd98bb 100644
--- a/examples/react/with-trpc/package.json
+++ b/examples/react/with-trpc/package.json
@@ -13,8 +13,8 @@
   "dependencies": {
     "@tanstack/react-query": "^4.36.1",
     "@tanstack/react-query-devtools": "^4.36.1",
-    "@tanstack/react-router": "^1.44.2",
-    "@tanstack/router-devtools": "^1.44.2",
+    "@tanstack/react-router": "^1.44.4",
+    "@tanstack/router-devtools": "^1.44.4",
     "@trpc/client": "^10.45.2",
     "@trpc/react-query": "^10.45.2",
     "@trpc/server": "^10.45.2",
diff --git a/packages/react-router/package.json b/packages/react-router/package.json
index 5d66d9e44..dddaff43f 100644
--- a/packages/react-router/package.json
+++ b/packages/react-router/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/react-router",
-  "version": "1.44.2",
+  "version": "1.44.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/react-router/src/route.ts b/packages/react-router/src/route.ts
index 28ee07d26..05a5d67f4 100644
--- a/packages/react-router/src/route.ts
+++ b/packages/react-router/src/route.ts
@@ -765,7 +765,7 @@ export class Route<
     this.to = fullPath as TrimPathRight<TFullPath>
   }
 
-  addChildren = <
+  addChildren<
     const TNewChildren extends
       | Record<string, AnyRoute>
       | ReadonlyArray<AnyRoute>,
@@ -791,7 +791,7 @@ export class Route<
     TLoaderDataReturn,
     TLoaderData,
     TNewChildren
-  > => {
+  > {
     this.children = (
       Array.isArray(children) ? children : Object.values(children)
     ) as any
@@ -1061,6 +1061,7 @@ export class RootRoute<
   TLoaderDeps extends Record<string, any> = {},
   TLoaderDataReturn = {},
   in out TLoaderData = ResolveLoaderData<TLoaderDataReturn>,
+  TChildren = unknown,
 > extends Route<
   any, // TParentRoute
   '/', // TPath
@@ -1080,7 +1081,7 @@ export class RootRoute<
   TLoaderDeps,
   TLoaderDataReturn,
   TLoaderData,
-  any // TChildren
+  TChildren // TChildren
 > {
   /**
    * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
@@ -1099,6 +1100,27 @@ export class RootRoute<
   ) {
     super(options as any)
   }
+
+  addChildren<
+    const TNewChildren extends
+      | Record<string, AnyRoute>
+      | ReadonlyArray<AnyRoute>,
+  >(
+    children: TNewChildren,
+  ): RootRoute<
+    TSearchSchemaInput,
+    TSearchSchema,
+    TSearchSchemaUsed,
+    TRouteContextReturn,
+    TRouteContext,
+    TRouterContext,
+    TLoaderDeps,
+    TLoaderDataReturn,
+    TLoaderData,
+    TNewChildren
+  > {
+    return super.addChildren(children)
+  }
 }
 
 export function createRootRoute<
diff --git a/packages/react-router/src/router.ts b/packages/react-router/src/router.ts
index 65bf0528c..e19000445 100644
--- a/packages/react-router/src/router.ts
+++ b/packages/react-router/src/router.ts
@@ -104,6 +104,7 @@ export interface Register {
 }
 
 export type AnyRouter = Router<any, any, any, any>
+
 export type AnyRouterWithContext<TContext> = Router<
   AnyRouteWithContext<TContext>,
   any,
@@ -132,6 +133,7 @@ export type InferRouterContext<TRouteTree extends AnyRoute> =
     infer TRouterContext extends AnyContext,
     any,
     any,
+    any,
     any
   >
     ? TRouterContext
diff --git a/packages/react-router/src/scroll-restoration.tsx b/packages/react-router/src/scroll-restoration.tsx
index c162839f7..e3de07d5a 100644
--- a/packages/react-router/src/scroll-restoration.tsx
+++ b/packages/react-router/src/scroll-restoration.tsx
@@ -47,7 +47,15 @@ export type ScrollRestorationOptions = {
   getKey?: (location: ParsedLocation) => string
 }
 
-const defaultGetKey = (location: ParsedLocation) => location.state.key!
+/**
+ * The default `getKey` function for `useScrollRestoration`.
+ * It returns the `key` from the location state or the `href` of the location.
+ *
+ * The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render.
+ */
+const defaultGetKey = (location: ParsedLocation) => {
+  return location.state.key! || location.href
+}
 
 export function useScrollRestoration(options?: ScrollRestorationOptions) {
   const router = useRouter()
diff --git a/packages/router-cli/package.json b/packages/router-cli/package.json
index 04646c65e..febd4cd57 100644
--- a/packages/router-cli/package.json
+++ b/packages/router-cli/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-cli",
-  "version": "1.44.2",
+  "version": "1.44.3",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-devtools/package.json b/packages/router-devtools/package.json
index 4170e40e7..8a3057532 100644
--- a/packages/router-devtools/package.json
+++ b/packages/router-devtools/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-devtools",
-  "version": "1.44.2",
+  "version": "1.44.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-generator/package.json b/packages/router-generator/package.json
index 0f2fc2a92..d7b0eb461 100644
--- a/packages/router-generator/package.json
+++ b/packages/router-generator/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-generator",
-  "version": "1.44.2",
+  "version": "1.44.3",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-generator/src/generator.ts b/packages/router-generator/src/generator.ts
index 0fd91bd9c..591d4e110 100644
--- a/packages/router-generator/src/generator.ts
+++ b/packages/router-generator/src/generator.ts
@@ -9,6 +9,7 @@ let latestTask = 0
 export const rootPathId = '__root'
 const routeGroupPatternRegex = /\(.+\)/g
 const possiblyNestedRouteGroupPatternRegex = /\([^/]+\)\/?/g
+const disallowedRouteGroupConfiguration = /\(([^)]+)\).(ts|js|tsx|jsx)/
 
 export type RouteNode = {
   filePath: string
@@ -82,6 +83,12 @@ async function getRouteNodes(config: Config) {
             routePath = routePath.replaceAll(routeFilePrefix, '')
           }
 
+          if (disallowedRouteGroupConfiguration.test(dirent.name)) {
+            const errorMessage = `A route configuration for a route group was found at \`${filePath}\`. This is not supported. Did you mean to use a layout/pathless route instead?`
+            logger.error(`ERROR: ${errorMessage}`)
+            throw new Error(errorMessage)
+          }
+
           const variableName = routePathToVariable(routePath)
 
           // Remove the index from the route path and
diff --git a/packages/router-generator/tsconfig.json b/packages/router-generator/tsconfig.json
index b36d1bf92..604fde555 100644
--- a/packages/router-generator/tsconfig.json
+++ b/packages/router-generator/tsconfig.json
@@ -1,4 +1,5 @@
 {
   "extends": "../../tsconfig.json",
-  "include": ["src", "vite.config.ts"]
+  "include": ["src", "vite.config.ts", "tests"],
+  "exclude": ["tests/generator/**/**"]
 }
diff --git a/packages/router-plugin/package.json b/packages/router-plugin/package.json
index 3bfdfdd9f..59877fc1c 100644
--- a/packages/router-plugin/package.json
+++ b/packages/router-plugin/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-plugin",
-  "version": "1.44.2",
+  "version": "1.44.3",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-vite-plugin/package.json b/packages/router-vite-plugin/package.json
index 97e0e4c9a..78a4a06a2 100644
--- a/packages/router-vite-plugin/package.json
+++ b/packages/router-vite-plugin/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-vite-plugin",
-  "version": "1.44.2",
+  "version": "1.44.3",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/start/package.json b/packages/start/package.json
index d1bcb574a..e645d8777 100644
--- a/packages/start/package.json
+++ b/packages/start/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start",
-  "version": "1.44.2",
+  "version": "1.44.4",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",


Test patch:
diff --git a/packages/react-router/tests/route.test-d.tsx b/packages/react-router/tests/route.test-d.tsx
index 630f4f2a3..563718091 100644
--- a/packages/react-router/tests/route.test-d.tsx
+++ b/packages/react-router/tests/route.test-d.tsx
@@ -567,6 +567,7 @@ test('when creating a child route with context, search, params and beforeLoad',
 
   const router = createRouter({
     routeTree,
+    context: { userId: 'userId' },
   })
 
   type Router = typeof router
diff --git a/packages/react-router/tests/router.test-d.tsx b/packages/react-router/tests/router.test-d.tsx
index d6f839e37..9ec12d722 100644
--- a/packages/react-router/tests/router.test-d.tsx
+++ b/packages/react-router/tests/router.test-d.tsx
@@ -2,6 +2,7 @@ import { expectTypeOf, test } from 'vitest'
 import {
   createRootRoute,
   createRootRouteWithContext,
+  createRoute,
   createRouter,
 } from '../src'
 
@@ -48,3 +49,32 @@ test('when creating a router with context', () => {
       context: { userId: string }
     }>()
 })
+
+test('when creating a router with context and children', () => {
+  const rootRoute = createRootRouteWithContext<{ userId: string }>()()
+
+  const indexRoute = createRoute({
+    getParentRoute: () => rootRoute,
+    path: '/',
+  })
+
+  const routeTree = rootRoute.addChildren([indexRoute])
+
+  type RouteTree = typeof routeTree
+
+  expectTypeOf(createRouter<RouteTree, 'never'>)
+    .parameter(0)
+    .toHaveProperty('routeTree')
+    .toEqualTypeOf<RouteTree | undefined>()
+
+  expectTypeOf(createRouter<RouteTree, 'never'>)
+    .parameter(0)
+    .toHaveProperty('context')
+    .toEqualTypeOf<{ userId: string }>()
+
+  expectTypeOf(createRouter<RouteTree, 'never'>)
+    .parameter(0)
+    .toMatchTypeOf<{
+      context: { userId: string }
+    }>()
+})
diff --git a/packages/router-generator/tests/deny-route-group-config.test.ts b/packages/router-generator/tests/deny-route-group-config.test.ts
new file mode 100644
index 000000000..a1457f877
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config.test.ts
@@ -0,0 +1,62 @@
+import { join } from 'node:path'
+import { describe, expect, it } from 'vitest'
+
+import { generator, getConfig } from '../src'
+import type { Config } from '../src'
+
+function makeFolderDir(folder: string) {
+  return join(process.cwd(), 'tests', 'deny-route-group-config', folder)
+}
+
+async function setupConfig(
+  folder: string,
+  inlineConfig: Partial<Omit<Config, 'routesDirectory'>> = {},
+) {
+  const { generatedRouteTree = '/routeTree.gen.ts', ...rest } = inlineConfig
+  const dir = makeFolderDir(folder)
+
+  const config = await getConfig({
+    disableLogging: true,
+    routesDirectory: dir,
+    generatedRouteTree: dir + generatedRouteTree,
+    ...rest,
+  })
+  return config
+}
+
+type TestCases = Array<{
+  folder: string
+  expectedError: string
+}>
+
+describe('deny-route-group-config throws', () => {
+  it.each([
+    {
+      folder: 'flat-flat',
+      expectedError:
+        'A route configuration for a route group was found at `(group).tsx`. This is not supported. Did you mean to use a layout/pathless route instead?',
+    },
+    {
+      folder: 'nested-flat',
+      expectedError:
+        'A route configuration for a route group was found at `(group).tsx`. This is not supported. Did you mean to use a layout/pathless route instead?',
+    },
+    {
+      folder: 'flat-nested',
+      expectedError:
+        'A route configuration for a route group was found at `nested/(group).tsx`. This is not supported. Did you mean to use a layout/pathless route instead?',
+    },
+    {
+      folder: 'nested-nested',
+      expectedError:
+        'A route configuration for a route group was found at `nested/(group).tsx`. This is not supported. Did you mean to use a layout/pathless route instead?',
+    },
+  ] satisfies TestCases)(
+    'should throw an error for the folder: $folder',
+    async ({ folder, expectedError }) => {
+      const config = await setupConfig(folder)
+
+      expect(() => generator(config)).rejects.toThrowError(expectedError)
+    },
+  )
+})
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-flat/(group).index.tsx b/packages/router-generator/tests/deny-route-group-config/flat-flat/(group).index.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/flat-flat/(group).index.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-flat/(group).tsx b/packages/router-generator/tests/deny-route-group-config/flat-flat/(group).tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/flat-flat/(group).tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-flat/__root.tsx b/packages/router-generator/tests/deny-route-group-config/flat-flat/__root.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/flat-flat/__root.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-flat/about.tsx b/packages/router-generator/tests/deny-route-group-config/flat-flat/about.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/flat-flat/about.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-nested/__root.tsx b/packages/router-generator/tests/deny-route-group-config/flat-nested/__root.tsx
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-nested/about.tsx b/packages/router-generator/tests/deny-route-group-config/flat-nested/about.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/flat-nested/about.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-nested/nested/(group).index.tsx b/packages/router-generator/tests/deny-route-group-config/flat-nested/nested/(group).index.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/flat-nested/nested/(group).index.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/flat-nested/nested/(group).tsx b/packages/router-generator/tests/deny-route-group-config/flat-nested/nested/(group).tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/flat-nested/nested/(group).tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-flat/(group).tsx b/packages/router-generator/tests/deny-route-group-config/nested-flat/(group).tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/nested-flat/(group).tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-flat/(group)/index.tsx b/packages/router-generator/tests/deny-route-group-config/nested-flat/(group)/index.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/nested-flat/(group)/index.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-flat/__root.tsx b/packages/router-generator/tests/deny-route-group-config/nested-flat/__root.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/nested-flat/__root.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-flat/about.tsx b/packages/router-generator/tests/deny-route-group-config/nested-flat/about.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/nested-flat/about.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-nested/__root.tsx b/packages/router-generator/tests/deny-route-group-config/nested-nested/__root.tsx
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-nested/about.tsx b/packages/router-generator/tests/deny-route-group-config/nested-nested/about.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/nested-nested/about.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-nested/nested/(group).tsx b/packages/router-generator/tests/deny-route-group-config/nested-nested/nested/(group).tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/nested-nested/nested/(group).tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/deny-route-group-config/nested-nested/nested/(group)/index.tsx b/packages/router-generator/tests/deny-route-group-config/nested-nested/nested/(group)/index.tsx
new file mode 100644
index 000000000..ab504e42e
--- /dev/null
+++ b/packages/router-generator/tests/deny-route-group-config/nested-nested/nested/(group)/index.tsx
@@ -0,0 +1,1 @@
+/** */
diff --git a/packages/router-generator/tests/generator.test.ts b/packages/router-generator/tests/generator.test.ts
index 9d97d91e9..c4bb0c5e5 100644
--- a/packages/router-generator/tests/generator.test.ts
+++ b/packages/router-generator/tests/generator.test.ts
@@ -1,14 +1,15 @@
-import fs from 'fs/promises'
-import { join } from 'path'
-import { describe, it, expect } from 'vitest'
+import fs from 'node:fs/promises'
+import { join } from 'node:path'
+import { describe, expect, it } from 'vitest'
 
-import { generator, getConfig, type Config } from '../src'
+import { generator, getConfig } from '../src'
+import type { Config } from '../src'
 
 function makeFolderDir(folder: string) {
   return join(process.cwd(), 'tests', 'generator', folder)
 }
 
-async function readDir(...paths: string[]) {
+async function readDir(...paths: Array<string>) {
   const folders = await fs.readdir(
     join(process.cwd(), 'tests', 'generator', ...paths),
   )