Skip to content
Source
Sign inSign up
TanStack/devtools

`intent` bin conflicts with @tanstack/intent and imports removed subpath #525

Closedzlo120(GitHub profile, opens in a new tab) opened this issue 3 comments

TanStack Devtools version

v0.14.2

Framework/Library version

React v19.2.8; Node v24.20.0; Npm v11.19.0

Describe the bug and the steps to reproduce it

When installing the package dependencies in my project that include both @tanstack/intent and @tanstack/devtools, I've found there is a collision between these two package's bin outputs. They both define "bin": { "intent": "..." } in their respective package.json, but @tanstack/devtools's bin output (implemented at bin/intent.js) tries to import '@tanstack/intent/intent-library' which results in a ERR_PACKAGE_PATH_NOT_EXPORTED error as this export path was removed from @tanstack/intent (there is a reference to the Intent issue below).

In both my React project and in the minimum reproducible example provided, running npm ci/npm i resolves node_modules/.bin/intent to the bin output from @tanstack/devtools rather than @tanstack/intent. Another engineer on my team sees this same behaviour, but another engineer can correctly resolve @tanstack/intent's bin at node_modules/.bin/intent.

Reproducible steps In the minimum reproducible example there is a simple node project which has two dependencies (intent and devtools).

  1. Install the dependencies in the minimum reproducible example project
  2. Run npm run help

The node_modules/.bin/intent resolves to devtool's, then running npm run help executes intent help and because the incorrect intent bin is installed, an ERR_PACKAGE_PATH_NOT_EXPORTED error is thrown.

Intent issue #143 removed intent-library from @tanstack/intent's exports.

Breaking: anything invoking intent-library directly must move to the normal intent discovery flow. No compatibility shim.

https://github.com/zlo120/intent-bin-min-repro-example/tree/main

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I think I know how to fix it and will discuss it in the comments of this issue

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. Repro'd on a fresh TanStack Start / React 19 project (bun 1.4.3, node 26.12.0, @tanstack/intent 0.5.5), and one addition: the collision is broader than one package — four packages in the same tree each declare { "bin": { "intent": ... } }:

    • @tanstack/devtools@0.15.0
    • @tanstack/devtools-vite@0.8.5
    • @tanstack/devtools-utils@0.4.0
    • @tanstack/devtools-event-client@0.5.0

    In our tree node_modules/.bin/intent consistently resolves to @tanstack/devtools/bin/intent.js.

    Observed behavior:

    • With @tanstack/intent installed as the shim's own error message recommends, every direct invocation hard-crashes with ERR_PACKAGE_PATH_NOT_EXPORTED (./intent-library was deliberately removed from the package in 0.0.42 / intent#143): bunx intent, bunx @tanstack/intent, and npx @tanstack/intent all hit the shim.
    • Without a local @tanstack/intent, the shim at least prints the friendly "not installed" message.
    • npx @tanstack/intent@latest only works when the local install is absent (npx then fetches from the registry), so following the shim's advice breaks the very npx command it suggests.
    • bunx @tanstack/intent cannot be made to work either way: bunx resolves the command name against the local node_modules/.bin first, so the shim always wins — including the form intent itself recommends in its output, bunx --no-install --package @tanstack/intent intent load <pkg>#<skill> (that exact invocation crashes identically).

    The last point means the collision also breaks the skill-loading workflow in any consumer project that has one of these packages installed: intent list prints "Load:" commands for agents to run, and they all die on the shim.

    The generated shim is also published by other projects (e.g. trpc: client/server/next/openapi/tanstack-react-query; electric-sql/electric: typescript-client/y-electric; durable-streams: aisdk-transport/y-durable-streams/tanstack-ai-transport), so this looks like a broad cleanup rather than a devtools-specific fix. Since the library-bin discovery model was abandoned (intent 0.0.42 changelog: "no compatibility shim"), the affected packages can drop the intent entry from bin and delete the generated bin/intent.js.

  2. Also hitting this on a fresh bunx @tanstack/cli@latest create scaffold (bun 1.4.2, @tanstack/devtools 0.15.0, @tanstack/intent 0.5.6): the scaffold's intent install step fails, and the bunx ... intent commands written to AGENTS.md fail with ERR_PACKAGE_PATH_NOT_EXPORTED. #542 fixes this the same way router did in TanStack/router#7333. Would be great to get it reviewed and released 🙏

  3. AlemTuzlak closed this

Sign in to join this conversation.