Skip to content
Source
Sign inSign up
TanStack/intent

intent list finds no packages with pnpm (symlink issue) #39

ClosedKyleAMathews opened this issue 0 comments
KyleAMathewscommented

Bug

intent list returns "No intent-enabled packages found" when using pnpm, even though packages with skills/ directories are correctly installed.

Root cause

In src/scanner.ts, scanForIntents uses readdirSync with { withFileTypes: true } and then filters on entry.isDirectory(). pnpm creates symlinks in node_modules/ pointing to its content-addressable store. Dirent.isDirectory() returns false for symbolic links — only Dirent.isSymbolicLink() returns true.

This means the scanner skips every package directory and finds nothing.

// Current behavior:
for (const entry of topEntries) {
  if (!entry.isDirectory()) continue;  // ← false for pnpm symlinks, skips everything
  // ...
}

Confirmed with:

const entries = fs.readdirSync('node_modules/@tanstack', { withFileTypes: true });
for (const e of entries) {
  console.log(e.name, 'isDir:', e.isDirectory(), 'isSym:', e.isSymbolicLink());
}
// db isDir: false isSym: true
// react-db isDir: false isSym: true
// intent isDir: false isSym: true

Fix

The directory check should also accept symlinks (which in node_modules always point to directories):

if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;

This applies to both the top-level scan loop and the scoped (@-prefixed) inner loop.

Environment

  • @tanstack/intent: 0.0.10
  • pnpm: 10.28.2
  • Node: v22.13.1
  • macOS (Darwin 23.3.0)

Reproduction

mkdir /tmp/intent-repro && cd /tmp/intent-repro
pnpm init
pnpm add @tanstack/intent @electric-sql/client@1.5.11
pnpm exec intent list
# → "No intent-enabled packages found."

Sign in to join this conversation.