Skip to content

Incomplete typedeclaration from 1.157.8 in @tanstack/router-core #6573

@oddsund

Description

@oddsund

Which project does this relate to?

Router

Describe the bug

From v1.157.8, the node_modules/@tanstack/router-core/dist/esm/path.d.ts file contains the following:

interface InterpolatePathOptions {
    path?: string;
    params: Record<string, unknown>;
    /**
     * A function that decodes a path parameter value.
     * Obtained from `compileDecodeCharMap(pathParamsAllowedCharacters)`.
     */
    decoder?: (encoded: string) => string;
}

export declare function interpolatePath({ path, params, decoder, server, }: InterpolatePathOptions): InterPolatePathResult;

As you can see, InterpolatePathOptions has no server property. This causes our vite-build to fail with an error pointing to this file.

What's weird is that InterpolatePathOptions in node_modules/@tanstack/router-core/src/path.ts has the server field, so it should be there. 🤷

Your Example Website or App

https://stackblitz.com/edit/tanstack-react-router-interpolatepathresult-bug?file=package.json&startScript=tsc

Steps to Reproduce the Bug or Issue

Verified that the buggy code is present from 1.157.8 onwards by checking out the file dist/esm/path.d.ts via https://www.npmjs.com/package/@tanstack/router-core/v/1.157.8?activeTab=code

https://www.npmjs.com/package/@tanstack/router-core/v/1.157.7?activeTab=code shows the code without the server field.

Expected behavior

No build error.

Screenshots or Videos

No response

Platform

  • @tanstack/router-core: 1.157.8 onwards
  • OS: macOS
  • Bundler: Vite
  • Bundler Version: 7.3.1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    typesChanges to the typescript types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions