Closed
Description
Which project does this relate to?
Router
Describe the bug
The title is self explanatory, removing skipLibCheck
from tsconfig causes type errors from the tanstack/router-core
pacakge. I can't have skipLibCheck
because I want my d.ts files to be checked.
node_modules/.pnpm/@tanstack+router-core@1.119.0/node_modules/@tanstack/router-core/dist/esm/route.d.ts:370:22 - error TS2420: Class 'BaseRoute<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, ... 5 more ..., TFileRouteTypes>' incorrectly implements interface 'Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, ... 5 more ..., TFileRouteTypes>'.
Type 'BaseRoute<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, ... 5 more ..., TFileRouteTypes>' is missing the following properties from type 'Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, ... 5 more ..., TFileRouteTypes>': useMatch, useRouteContext, useSearch, useParams, and 4 more.
370 export declare class BaseRoute<in out TParentRoute extends AnyRoute = AnyRoute, in out TPath extends string = '/', in out TFullPath extends string = ResolveFullPath<TParentRoute, TPath>, in out TCustomId extends string = string, in out TId extends string = ResolveId<TParentRoute, TCustomId, TPath>, in out TSearchValidator = undefined, in out TParams = ResolveParams<TPath>, in out TRouterContext = AnyContext, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown> implements Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes> {
~~~~~~~~~
node_modules/.pnpm/@tanstack+router-core@1.119.0/node_modules/@tanstack/router-core/dist/esm/route.d.ts:403:23 - error TS2344: Type 'this' does not satisfy the constraint 'AnyRoute'.
Type 'BaseRoute<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, ... 5 more ..., TFileRouteTypes>' is missing the following properties from type 'Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any>': useMatch, useRouteContext, useSearch, useParams, and 4 more.
403 lazy: RouteLazyFn<this>;
~~~~
Your Example Website or App
Steps to Reproduce the Bug or Issue
- npx create-tsrouter-app@latest my-app --template file-router
- remove
skipLibCheck
from tsconfig - run
tsc --build --noEmit
Expected behavior
I expect no type errors to occure.
Screenshots or Videos
No response
Platform
- OS: [Linux]
- Browser: not relevant
- Version: [1.120.2]
Additional context
No response