Skip to content

type errors when using ts project references / declarationΒ #1012

@marbemac

Description

@marbemac
  • I've validated the bug against the latest version of DB packages

Describe the bug

Getting the dreaded The inferred type of "xyz" cannot be named without a reference to ../node_modules/.pnpm/@[email protected][email protected]/node_modules/@tanstack/db/dist/esm/query/builder/types. This is likely not portable. A type annotation is necessary. error when trying to use query joins in a project that uses ts project references.

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/getdatanaut/tanstack-repro
  2. pnpm i
  3. Open src/index.ts and you should see the ts error.

Or just copy https://github.com/getdatanaut/tanstack-repro/blob/main/src/index.ts into a project that has declaration: true in the tsconfig.json.

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