Skip to content
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

Property 'hasNotFoundMatch' does not exist on type Router #3734

Open
mskubak opened this issue Mar 10, 2025 · 1 comment
Open

Property 'hasNotFoundMatch' does not exist on type Router #3734

mskubak opened this issue Mar 10, 2025 · 1 comment
Labels
types Changes to the typescript types

Comments

@mskubak
Copy link

mskubak commented Mar 10, 2025

Which project does this relate to?

Router

Describe the bug

Since version 1.113.0 I got error message "Property 'hasNotFoundMatch' does not exist on type Router" on Typescript (v5.7.3) transpile. Build with vite works fine, so I guess it could be a missing declaration.

Your Example Website or App

https://tanstack.com/router/latest/docs/framework/react/guide/ssr#all-together-now

Steps to Reproduce the Bug or Issue

From this example: https://tanstack.com/router/latest/docs/framework/react/guide/ssr#all-together-now

const router = createRouter()

...

await router.load()

response.statusCode = router.hasNotFoundMatch() ? 404 : 200

Expected behavior

I expected that method hasNotFoundMatch exist on type Router.

Screenshots or Videos

No response

Platform

  • OS: all
  • Browser: all
  • Version: all

Additional context

No response

@gar1t
Copy link

gar1t commented Mar 20, 2025

I'm using vite in a SolidJS (start) environment. This method is missing for me as well.

This is my workaround (copying from the router source):

const not_found = router.__store.state.matches.some(
   (d) => d.status === "notFound" || d.globalNotFound,
);

@schiller-manuel schiller-manuel added the types Changes to the typescript types label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Changes to the typescript types
Projects
None yet
Development

No branches or pull requests

3 participants