Skip to content

fix(router-core): change error type in ErrorComponentProps#4691

Merged
schiller-manuel merged 5 commits into
TanStack:mainfrom
leesb971204:fix/error-component-props-type
Jul 20, 2025
Merged

fix(router-core): change error type in ErrorComponentProps#4691
schiller-manuel merged 5 commits into
TanStack:mainfrom
leesb971204:fix/error-component-props-type

Conversation

@leesb971204

@leesb971204 leesb971204 commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

fixes #4686

Signed-off-by: leesb971204 <leesb971204@gmail.com>
@nx-cloud

nx-cloud Bot commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 21d3dff

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

☁️ Nx Cloud last updated this comment at 2025-07-20 02:32:35 UTC

Comment thread packages/router-core/src/route.ts Outdated
Signed-off-by: leesb971204 <leesb971204@gmail.com>
@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2025

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-with-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-plugin

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-plugin

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-server-functions-client

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

@tanstack/start-server-functions-fetcher

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

@tanstack/start-server-functions-server

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 21d3dff

@leesb971204 leesb971204 force-pushed the fix/error-component-props-type branch from 21713c1 to cc66bfd Compare July 19, 2025 12:25
Comment on lines -1320 to +1321
export type ErrorComponentProps = {
error: Error
export type ErrorComponentProps<TError = Error> = {
error: TError

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This reflects @michaelbull ’s suggestion.

The change respects the diversity of error objects returned from the backend while setting Error as the default type to ensure compatibility with existing code.

@schiller-manuel

Copy link
Copy Markdown
Collaborator

thanks for this PR!

can you please update the docs

docs/router/framework/react/api/router/errorComponentComponent.md

Signed-off-by: leesb971204 <leesb971204@gmail.com>
@github-actions github-actions Bot added the documentation Everything documentation related label Jul 20, 2025
@leesb971204

Copy link
Copy Markdown
Contributor Author

thanks for this PR!

can you please update the docs

docs/router/framework/react/api/router/errorComponentComponent.md

I updated the type of the error, and also added a description for info, which seemed to be missing.

@schiller-manuel schiller-manuel merged commit e63f4e4 into TanStack:main Jul 20, 2025
5 checks passed
Sign up for free to 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.

ErrorComponentProps#error incorrectly models the error type

3 participants