Skip to content

Commit 778c73b

Browse files
cevianclaude
andcommitted
fix(dev-ui): resolve extensionless node imports for descriptions and integrations
Turbopack/bundler generates imports without .js extensions (e.g. ../../nodes/foo). The watcher only handled .js→.ts conversion, so these imports silently failed, hiding node descriptions and integration connect buttons. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 74f5ccb commit 778c73b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/core/src/dev-ui/watcher.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export function createWatcher(options: WatcherOptions) {
5151
// Convert .js extension to .ts for source files
5252
if (importFile.endsWith(".js")) {
5353
importFile = importFile.slice(0, -3) + ".ts";
54+
} else if (!extname(importFile)) {
55+
// Extensionless imports (e.g. from Turbopack/bundler) — try .ts
56+
importFile = importFile + ".ts";
5457
}
5558
let resolvedPath = resolve(dirname(absPath), importFile);
5659
if (!existsSync(resolvedPath)) {
@@ -74,8 +77,8 @@ export function createWatcher(options: WatcherOptions) {
7477
if (integrations) {
7578
node.integrations = integrations;
7679
}
77-
} catch {
78-
// Skip nodes we can't resolve
80+
} catch (err) {
81+
console.warn(`[watcher] Error resolving node ${node.importPath}:`, err);
7982
}
8083
}
8184
}

0 commit comments

Comments
 (0)