Skip to content
Source
Sign inSign up
TanStack/db

type errors when using ts project references / declaration #1012

Closedmarbemac(GitHub profile, opens in a new tab) opened this issue 2 comments
  • 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/@tanstack+db@0.5.11_typescript@5.9.3/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.

  1. Hi @marbemac,

    Thank you for your reproduction which helped confirming the issue. I opened a PR that fixes it. I can confirm that it solves the problems from your reproduction.

Sign in to join this conversation.