Skip to content

InferStructuralSharing missing in published types (esm/cjs) #5116

Closed

Description

@perbergland

Which project does this relate to?

Router

Describe the bug

After updating from @tanstack/router 1.129.8 to 1.131.36 I got typescript compilation errors for the distributed types:

node_modules/@tanstack/react-router/dist/esm/index.d.ts:49:36 - error TS2305: Module '"./typePrimitives.js"' has no exported member 'InferStructuralSharing'.

49 export type { ValidateLinkOptions, InferStructuralSharing, ValidateUseSearchOptions, ValidateUseParamsOptions, ValidateLinkOptionsArray, } from './typePrimitives.js';
                                      ~~~~~~~~~~~~~~~~~~~~~~

When reviewing the node_modules/@tanstack/react-router/dist/esm/typePrimitives.d.ts file, it lacks the InferStructuralSharing type.

Version 1.129.8 includes this type, defined in typePrimitives.d.ts as

/**
 * @internal
 */
export type InferStructuralSharing<TOptions> = TOptions extends {
    structuralSharing: infer TStructuralSharing;
} ? TStructuralSharing : unknown;

Your Example Website or App

https://stackblitz.com/edit/github-h1spuhyh?file=tsconfig.json

Steps to Reproduce the Bug or Issue

set skipLibCheck: false

npm i
node_modules/typescript/bin/tsc --noEmit

Expected behavior

No typescript errors

Screenshots or Videos

Image

Platform

  • Router Version: 1.131.36
  • Typescript: any recent version

Additional context

No response

Activity

  1. added a commit that references this issue on Sep 15, 2025
    bfc466f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions