Skip to content

chore: update express and webpack-dev-server#7443

Merged
Sheraff merged 2 commits into
mainfrom
opencode/nimble-island
May 20, 2026
Merged

chore: update express and webpack-dev-server#7443
Sheraff merged 2 commits into
mainfrom
opencode/nimble-island

Conversation

@Sheraff
Copy link
Copy Markdown
Collaborator

@Sheraff Sheraff commented May 20, 2026

Summary

  • update direct Express dependencies in examples and e2e apps to 5.2.1
  • update direct @types/express dependencies to 5.0.6
  • migrate Express 5 wildcard routes and app.listen error callback handling
  • update Webpack quickstart examples to webpack-dev-server 5.2.4

Testing

  • pnpm install --lockfile-only
  • pnpm install
  • pnpm install --lockfile-only --fix-lockfile
  • git diff --check
  • targeted Nx builds for React/Solid/Vue example and e2e apps
  • runtime checks for /{*splat} matching / and /posts/1
  • reviewed webpack-dev-server changelog from 5.2.0 to 5.2.4; no config/code migration required for affected examples
  • CI=1 NX_DAEMON=false pnpm nx run tanstack-router-react-example-quickstart-webpack-file-based:build --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run tanstack-router-solid-example-quickstart-webpack-file-based:build --outputStyle=stream --skipRemoteCache
  • timeout 25s pnpm --dir examples/react/quickstart-webpack-file-based exec webpack serve --port 0 --no-open
  • timeout 25s pnpm --dir examples/solid/quickstart-webpack-file-based exec webpack serve --port 0 --no-open

Summary by CodeRabbit

  • Chores

    • Updated Express framework dependency to v5.2.1 across projects and examples.
    • Updated Express type definitions to v5.0.6 for improved TypeScript support.
    • Bumped webpack-dev-server in a couple of examples to v5.2.4.
  • Bug Fixes

    • Enhanced server startup error handling to throw immediately on listen failures.
    • Adjusted fallback route patterns to an explicit splat (/{*splat}) for more accurate SSR/static routing.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

This PR bumps Express (and matching types) to v5.2.1 across e2e and example manifests, changes server startup callbacks to an error-first signature that throws on listen failures, and replaces wildcard catch-all routes with explicit splat patterns in SSR/fallback handlers.

Changes

Express v5.2.1 upgrade and error-handling integration

Layer / File(s) Summary
Dependency version updates to Express v5.2.1 and @types/express v5.0.6
e2e/react-start/basic/package.json, e2e/react-start/css-inline/package.json, e2e/react-start/custom-basepath/package.json, e2e/react-start/custom-server-rsbuild/package.json, e2e/react-start/split-base-and-basepath/package.json, e2e/react-start/transform-asset-urls/package.json, e2e/solid-start/basic/package.json, e2e/solid-start/custom-basepath/package.json, e2e/vue-start/basic/package.json, e2e/vue-start/custom-basepath/package.json, examples/react/basic-ssr-file-based/package.json, examples/react/basic-ssr-streaming-file-based/package.json, examples/react/with-trpc-react-query/package.json, examples/react/with-trpc/package.json, examples/solid/basic-ssr-file-based/package.json, examples/solid/basic-ssr-streaming-file-based/package.json, examples/solid/with-trpc/package.json, examples/react/quickstart-webpack-file-based/package.json, examples/solid/quickstart-webpack-file-based/package.json
Updated Express runtime constraints to ^5.2.1 and aligned @types/express to ^5.0.6 where applicable; webpack-dev-server bumped in two example manifests.
Error-aware callbacks in app.listen startup across all servers
e2e/react-start/basic/server.js, e2e/react-start/css-inline/server.js, e2e/react-start/custom-basepath/express-server.ts, e2e/react-start/custom-server-rsbuild/express-server.ts, e2e/react-start/split-base-and-basepath/prod-server.js, e2e/react-start/transform-asset-urls/tests/cdn-server.mjs, e2e/solid-start/basic/server.js, e2e/solid-start/custom-basepath/express-server.ts, e2e/vue-start/basic/server.js, e2e/vue-start/custom-basepath/express-server.ts, examples/react/basic-ssr-file-based/server.js, examples/react/basic-ssr-streaming-file-based/server.js, examples/react/with-trpc-react-query/src/server/server.ts, examples/react/with-trpc/src/server/server.ts, examples/solid/basic-ssr-file-based/server.js, examples/solid/basic-ssr-streaming-file-based/server.js, examples/solid/with-trpc/src/server/server.ts
All server startup callbacks now accept an (error) argument and throw when it is non-null, applied consistently in dev and production branches where present.
Route pattern migration to Express v5 splat syntax
examples/react/basic-ssr-file-based/server.js, examples/react/basic-ssr-streaming-file-based/server.js, examples/react/with-trpc-react-query/src/server/server.ts, examples/react/with-trpc/src/server/server.ts, examples/solid/basic-ssr-file-based/server.js, examples/solid/basic-ssr-streaming-file-based/server.js, examples/solid/with-trpc/src/server/server.ts
Catch-all and fallback route patterns migrated from wildcard syntax ('*', app.use('*', ...)) to explicit splat patterns ('/{*splat}', app.get('/{*splat}', ...)) where SSR or client fallback routing is registered.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TanStack/router#6792: Initial server startup error handling introduction in prod-server.js that is now being consistently applied across server bootstraps.

Suggested labels

package: react-start, package: solid-start, package: vue-start, package: start-server-core

Suggested reviewers

  • SeanCassiere
  • beaussan

Poem

🐰 A hop to v five point two and one,
I swapped the wildcards for splats—what fun!
Now listen errors no longer hide,
They leap out loud and catch the tide.
Dependencies snug, the servers run.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary changes: updating Express and webpack-dev-server dependencies across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch opencode/nimble-island

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

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 20, 2026

View your CI Pipeline Execution ↗ for commit 2efb369

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 1m 17s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-20 08:35:40 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

🚀 Changeset Version Preview

9 package(s) bumped directly, 15 bumped as dependents.

🟨 Minor bumps

Package Version Reason
@tanstack/react-start-client 1.167.4 → 1.168.0 Changeset
@tanstack/solid-start-client 1.167.4 → 1.168.0 Changeset
@tanstack/start-client-core 1.169.4 → 1.170.0 Changeset
@tanstack/start-plugin-core 1.170.6 → 1.171.0 Changeset
@tanstack/start-server-core 1.168.4 → 1.169.0 Changeset

🟩 Patch bumps

Package Version Reason
@tanstack/router-cli 1.167.5 → 1.167.6 Changeset
@tanstack/router-core 1.171.2 → 1.171.3 Changeset
@tanstack/router-plugin 1.168.6 → 1.168.7 Changeset
@tanstack/router-utils 1.162.0 → 1.162.1 Changeset
@tanstack/react-router 1.170.4 → 1.170.5 Dependent
@tanstack/react-start 1.168.6 → 1.168.7 Dependent
@tanstack/react-start-rsc 0.1.6 → 0.1.7 Dependent
@tanstack/react-start-server 1.167.4 → 1.167.5 Dependent
@tanstack/router-generator 1.167.5 → 1.167.6 Dependent
@tanstack/router-vite-plugin 1.167.6 → 1.167.7 Dependent
@tanstack/solid-router 1.170.4 → 1.170.5 Dependent
@tanstack/solid-start 1.168.6 → 1.168.7 Dependent
@tanstack/solid-start-server 1.167.4 → 1.167.5 Dependent
@tanstack/start-static-server-functions 1.167.4 → 1.167.5 Dependent
@tanstack/start-storage-context 1.167.4 → 1.167.5 Dependent
@tanstack/vue-router 1.170.4 → 1.170.5 Dependent
@tanstack/vue-start 1.168.6 → 1.168.7 Dependent
@tanstack/vue-start-client 1.167.4 → 1.167.5 Dependent
@tanstack/vue-start-server 1.167.4 → 1.167.5 Dependent

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 20, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​express@​5.0.61001007184100
Addedexpress@​5.2.19810010091100
Addedwebpack-dev-server@​5.2.49410010092100

View full report

Copy link
Copy Markdown
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/react-start/custom-server-rsbuild/express-server.ts`:
- Around line 60-63: The async callback passed to app.listen causes thrown
errors and rejected awaits to become unhandled promise rejections; change the
startup to use a non-async callback and chain devServer.afterListen() with
.then().catch() (or call devServer.afterListen().then(() => { console.log...
}).catch(err => { processLogger.error/console.error(err); process.exit(1); }))
so errors from devServer.afterListen() and the listen call are caught and the
process exits on failure; update the code surrounding httpServer, app.listen,
devServer.afterListen, and PORT to remove the async modifier and add explicit
.then/.catch error handling.

In `@examples/solid/basic-ssr-streaming-file-based/server.js`:
- Around line 100-101: The console message hardcodes 3000 instead of the actual
port returned by getPort; fix by resolving the port before calling app.listen
(e.g., const port = await getPort({ port: portNumbers(3000, 3100) })), pass that
port into app.listen(port, ...), and update the console.info call to
interpolate/use that port variable (e.g., use port in the URL string) while
keeping the existing error callback (error => { if (error) throw error }) as-is;
update references to getPort, portNumbers, app.listen, and the console.info call
accordingly.

In `@examples/solid/with-trpc/src/server/server.ts`:
- Around line 81-82: Replace the current use of app.listen(PORT, (error) => { if
(error) throw error } ) with code that captures the returned server instance
from app.listen(PORT) and attaches an 'error' event handler to that server to
handle startup failures; specifically, stop throwing from the listen callback
and instead call app.listen(PORT) to get the server object, then register
server.on('error', (err) => { /* log/handle err */ }) (you can also add
server.on('listening', ...) or a callback that only logs success) so startup
errors are handled via the server's 'error' event rather than throwing inside
the listen callback.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 513883fa-1ba5-4a4d-83e5-5e3f062cb940

📥 Commits

Reviewing files that changed from the base of the PR and between 9f6258f and e316165.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (34)
  • e2e/react-start/basic/package.json
  • e2e/react-start/basic/server.js
  • e2e/react-start/css-inline/package.json
  • e2e/react-start/css-inline/server.js
  • e2e/react-start/custom-basepath/express-server.ts
  • e2e/react-start/custom-basepath/package.json
  • e2e/react-start/custom-server-rsbuild/express-server.ts
  • e2e/react-start/custom-server-rsbuild/package.json
  • e2e/react-start/split-base-and-basepath/package.json
  • e2e/react-start/split-base-and-basepath/prod-server.js
  • e2e/react-start/transform-asset-urls/package.json
  • e2e/react-start/transform-asset-urls/tests/cdn-server.mjs
  • e2e/solid-start/basic/package.json
  • e2e/solid-start/basic/server.js
  • e2e/solid-start/custom-basepath/express-server.ts
  • e2e/solid-start/custom-basepath/package.json
  • e2e/vue-start/basic/package.json
  • e2e/vue-start/basic/server.js
  • e2e/vue-start/custom-basepath/express-server.ts
  • e2e/vue-start/custom-basepath/package.json
  • examples/react/basic-ssr-file-based/package.json
  • examples/react/basic-ssr-file-based/server.js
  • examples/react/basic-ssr-streaming-file-based/package.json
  • examples/react/basic-ssr-streaming-file-based/server.js
  • examples/react/with-trpc-react-query/package.json
  • examples/react/with-trpc-react-query/src/server/server.ts
  • examples/react/with-trpc/package.json
  • examples/react/with-trpc/src/server/server.ts
  • examples/solid/basic-ssr-file-based/package.json
  • examples/solid/basic-ssr-file-based/server.js
  • examples/solid/basic-ssr-streaming-file-based/package.json
  • examples/solid/basic-ssr-streaming-file-based/server.js
  • examples/solid/with-trpc/package.json
  • examples/solid/with-trpc/src/server/server.ts

Comment on lines +60 to 63
const httpServer = app.listen(PORT, async (error) => {
if (error) throw error
await devServer.afterListen()
console.log(`Server is running on http://localhost:${PORT}`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify async app.listen callbacks that throw in this repo.
rg -nP --type=ts -C2 'app\.listen\([^,]+,\s*async\s*\([^)]*\)\s*=>\s*\{'
rg -nP --type=ts -C2 'if\s*\(\s*error\s*\)\s*throw\s+error'

Repository: TanStack/router

Length of output: 4270


🏁 Script executed:

cat -n e2e/react-start/custom-server-rsbuild/express-server.ts

Repository: TanStack/router

Length of output: 3022


Handle promise rejections in the async app.listen callback.

Line 60 uses an async callback with app.listen, where throw error at line 61 becomes an unhandled Promise rejection instead of a synchronous startup failure. Additionally, the await devServer.afterListen() at line 62 could reject without being caught. Remove the async modifier and use explicit .then().catch() chaining to ensure errors are handled and the process exits on failure.

Proposed fix
-  const httpServer = app.listen(PORT, async (error) => {
-    if (error) throw error
-    await devServer.afterListen()
-    console.log(`Server is running on http://localhost:${PORT}`)
-  })
+  const httpServer = app.listen(PORT, (error) => {
+    if (error) throw error
+    devServer
+      .afterListen()
+      .then(() => {
+        console.log(`Server is running on http://localhost:${PORT}`)
+      })
+      .catch((afterListenError) => {
+        console.error(afterListenError)
+        process.exit(1)
+      })
+  })
📝 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 httpServer = app.listen(PORT, async (error) => {
if (error) throw error
await devServer.afterListen()
console.log(`Server is running on http://localhost:${PORT}`)
const httpServer = app.listen(PORT, (error) => {
if (error) throw error
devServer
.afterListen()
.then(() => {
console.log(`Server is running on http://localhost:${PORT}`)
})
.catch((afterListenError) => {
console.error(afterListenError)
process.exit(1)
})
})
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/react-start/custom-server-rsbuild/express-server.ts` around lines 60 -
63, The async callback passed to app.listen causes thrown errors and rejected
awaits to become unhandled promise rejections; change the startup to use a
non-async callback and chain devServer.afterListen() with .then().catch() (or
call devServer.afterListen().then(() => { console.log... }).catch(err => {
processLogger.error/console.error(err); process.exit(1); })) so errors from
devServer.afterListen() and the listen call are caught and the process exits on
failure; update the code surrounding httpServer, app.listen,
devServer.afterListen, and PORT to remove the async modifier and add explicit
.then/.catch error handling.

Comment on lines +100 to +101
app.listen(await getPort({ port: portNumbers(3000, 3100) }), (error) => {
if (error) throw error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

In Express 5 / Node.js, does app.listen callback receive an error argument, or are listen failures emitted on the server "error" event?

💡 Result:

In Express 5, the callback you pass to app.listen(...) can receive an error as its first argument when the server emits an error during the bind/listen step (e.g., EADDRINUSE). Express 5 no longer throws those listen-time errors by default; instead it invokes your callback and passes the error to it. [1] Therefore: listen failures are handled via the callback error argument in Express 5, while the underlying mechanism is that the server emits an 'error' event (Express wires that into the callback). [1] In Express 4, such errors would be thrown instead of being delivered to the callback. [1]

Citations:


🏁 Script executed:

#!/bin/bash
# Find and examine the package.json in the example directory
find examples/solid/basic-ssr-streaming-file-based -name "package.json" -type f | head -5

Repository: TanStack/router

Length of output: 118


🏁 Script executed:

#!/bin/bash
# Get the full context of server.js around lines 100-101
wc -l examples/solid/basic-ssr-streaming-file-based/server.js

Repository: TanStack/router

Length of output: 119


🏁 Script executed:

#!/bin/bash
# Read the server.js file with line numbers, focusing on the area around lines 100-101
sed -n '95,110p' examples/solid/basic-ssr-streaming-file-based/server.js | cat -n

Repository: TanStack/router

Length of output: 398


🏁 Script executed:

#!/bin/bash
# Read package.json to check Express version
cat examples/solid/basic-ssr-streaming-file-based/package.json

Repository: TanStack/router

Length of output: 997


🌐 Web query:

Express 5.0 app.listen error handling callback vs server error event

💡 Result:

In Express 5, startup/listen errors are delivered to the app.listen callback argument (if you provided one), rather than being thrown immediately as they were in Express 4. Express 5 documentation states: “app.listen … will invoke the user-provided callback function (if provided) when the server receives an error event … If there is an error, it will be passed to the callback as an argument.” [1] So which should you use? 1) app.listen callback for listen/startup failures (e.g., EADDRINUSE) Use the callback you pass to app.listen(port, host, (err) => …) to handle “server emits error during listen” cases. Express 5’s migration guide shows checking the first callback argument and throwing/logging it when it’s present. [1] 2) server error event (Node http server) for errors emitted by the underlying server Express’s app.listen is a convenience wrapper around Node’s http.Server.listen. [2] That means the underlying HTTP server is still the real object, and Node error semantics are based on EventEmitter’s ‘error’ event. [3][2] However, with Express 5 specifically, the framework has changed so that listen-time errors are routed into the app.listen callback (when provided). [1] Practical guidance (Express 5.0) - Prefer passing a callback to app.listen for startup/listen errors, and check the callback’s error argument. [1] - For other server-side errors that happen after the server is already listening, you would still typically attach an ‘error’ handler to the underlying server (or otherwise ensure ‘error’ events are handled), consistent with Node’s EventEmitter behavior. [3] Example (listen-time error via callback) const server = app.listen(8080, '0.0.0.0', (error) => { if (error) { // e.g. EADDRINUSE console.error(error); return; } console.log(Listening on ${JSON.stringify(server.address())}); }); [1] Key distinction - “Express request handling errors” (route/middleware) are handled via Express error-handling middleware (next(err) / async rejection forwarding, etc.). [4] - “Server listen/startup errors” are handled via the app.listen callback in Express 5. [1]

Citations:


Console message hardcodes port instead of using the dynamically allocated port.

The actual port is selected by getPort() on line 100, but the console.info message on line 101 hardcodes 3000. If the port falls back to a different value (e.g., 3001), the user sees incorrect information. Use the port variable in the message instead.

Regarding the error handling: The current callback pattern is correct for Express 5. According to Express 5 migration documentation, app.listen() routes startup/listen errors (like EADDRINUSE) into the callback's error argument—the pattern (error) => { if (error) throw error } is the intended way to handle bind failures in Express 5.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/solid/basic-ssr-streaming-file-based/server.js` around lines 100 -
101, The console message hardcodes 3000 instead of the actual port returned by
getPort; fix by resolving the port before calling app.listen (e.g., const port =
await getPort({ port: portNumbers(3000, 3100) })), pass that port into
app.listen(port, ...), and update the console.info call to interpolate/use that
port variable (e.g., use port in the URL string) while keeping the existing
error callback (error => { if (error) throw error }) as-is; update references to
getPort, portNumbers, app.listen, and the console.info call accordingly.

Comment on lines +81 to +82
app.listen(PORT, (error) => {
if (error) throw error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

For Express 5 + Node HTTP server, what is the correct way to handle app.listen startup failures (EADDRINUSE/EACCES)? Is an error argument passed to the listen callback?

💡 Result:

In Express 5, the behavior of app.listen has changed compared to Express 4 regarding error handling [1]. While Express 4 typically did not pass startup errors to the callback, Express 5 explicitly invokes the user-provided callback with an error argument if the server fails to start (e.g., due to EADDRINUSE or EACCES) [1]. To correctly handle startup failures in Express 5, you should check for the presence of an error argument in the callback function [1]: const server = app.listen(port, (error) => { if (error) { console.error('Failed to start server:', error); process.exit(1); // Handle the error appropriately } console.log('Server is listening on port', port); }); Alternatively, because app.listen returns the underlying Node.js http.Server instance, you can attach an error event listener directly to the server object [2][3]. This approach is robust and works consistently across different versions of Express and Node.js [2][4]: const server = app.listen(port); server.on('error', (error) => { if (error.code === 'EADDRINUSE') { console.error(Port ${port} is already in use.); } else { console.error('Server error:', error); } process.exit(1); }); Using the 'error' event is often preferred for complex startup logic, such as implementing retry mechanisms or logging specific error codes like EADDRINUSE or EACCES [2][4][5]. Note that if you do not handle the 'error' event, Node.js will emit an unhandled exception, which typically causes the process to crash [6].

Citations:


🏁 Script executed:

# Find package.json in the project to check Express version
fd -t f package.json | head -5

Repository: TanStack/router

Length of output: 222


🏁 Script executed:

# Examine the server.ts file to see the full context around lines 81-82
if [ -f "examples/solid/with-trpc/src/server/server.ts" ]; then
  echo "=== File exists, checking full context ==="
  wc -l "examples/solid/with-trpc/src/server/server.ts"
  echo ""
  echo "=== Lines 70-90 context ==="
  sed -n '70,90p' "examples/solid/with-trpc/src/server/server.ts"
else
  echo "File not found at specified path"
  find . -name "server.ts" -type f | grep -E "(solid|trpc)" | head -10
fi

Repository: TanStack/router

Length of output: 614


🏁 Script executed:

# Check the package.json in the examples/solid/with-trpc directory for Express version
if [ -f "examples/solid/with-trpc/package.json" ]; then
  echo "=== package.json found ==="
  cat "examples/solid/with-trpc/package.json" | grep -A 5 -B 5 "express"
else
  echo "Checking for package.json"
  find examples/solid/with-trpc -name "package.json" -type f
fi

Repository: TanStack/router

Length of output: 557


🏁 Script executed:

cat -n "examples/solid/with-trpc/src/server/server.ts"

Repository: TanStack/router

Length of output: 2978


🏁 Script executed:

# Check TypeScript configuration for strict mode
fd -t f tsconfig.json | xargs grep -l "strict" 2>/dev/null | head -3

Repository: TanStack/router

Length of output: 185


🏁 Script executed:

# Verify the typing of Express app.listen in Express 5
rg "listen" examples/solid/with-trpc/src/server/server.ts -B 3 -A 3

Repository: TanStack/router

Length of output: 249


Use the server's 'error' event for startup failures instead of relying on the listen callback.

While Express 5 does pass error arguments to the listen callback, the idiomatic and more robust approach in Node.js is to attach an error handler to the returned server instance. This pattern works across Node.js versions and prevents potential unhandled promise rejections (the current code throws an error in a .then() without a .catch() handler).

Suggested fix
-  createServer().then(({ app }) =>
-    app.listen(PORT, (error) => {
-      if (error) throw error
-      console.info(`Server available at: http://localhost:${PORT}`)
-    }),
-  )
+  createServer().then(({ app }) => {
+    const server = app.listen(PORT, () => {
+      console.info(`Server available at: http://localhost:${PORT}`)
+    })
+    server.on('error', (error) => {
+      throw error
+    })
+  })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/solid/with-trpc/src/server/server.ts` around lines 81 - 82, Replace
the current use of app.listen(PORT, (error) => { if (error) throw error } ) with
code that captures the returned server instance from app.listen(PORT) and
attaches an 'error' event handler to that server to handle startup failures;
specifically, stop throwing from the listen callback and instead call
app.listen(PORT) to get the server object, then register server.on('error',
(err) => { /* log/handle err */ }) (you can also add server.on('listening', ...)
or a callback that only logs success) so startup errors are handled via the
server's 'error' event rather than throwing inside the listen callback.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 20, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7443

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7443

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7443

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7443

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7443

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7443

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7443

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7443

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7443

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7443

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7443

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7443

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7443

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7443

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7443

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7443

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7443

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7443

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7443

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7443

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7443

commit: 2efb369

@Sheraff Sheraff changed the title chore: update express to v5.2.1 chore: update express and webpack-dev-server May 20, 2026
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

We investigated the failing tanstack-react-start-e2e-split-base-and-basepath:test:e2e task and found that the Chromium headless shell is crashing with a SIGSEGV (General Protection Fault) during browser launch — entirely unrelated to the Express v5.2.1 upgrade, route pattern changes, or listen callback updates in this PR. Our recommendation is to re-run the task, as this is an environment infrastructure issue that no code change can address.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@Sheraff Sheraff merged commit 697c66b into main May 20, 2026
12 of 13 checks passed
@Sheraff Sheraff deleted the opencode/nimble-island branch May 20, 2026 08:58
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.

1 participant