Fast discovery misses TypeScript NodeNext `.js` specifiers → silent WorkflowNotRegisteredError
@ijjk is already working on this.
Since Jul 28, 2026.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 365
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 169
Description
Summary
A .ts file using TypeScript NodeNext-style specifiers — export * from './x.js' (what TS itself prescribes) — is invisible to workflow fast discovery. The build succeeds, the workflow/step never registers, and the first signal is a runtime WorkflowNotRegisteredError. esbuild resolves the same specifier fine during bundling, so only the discovery pass is affected.
Where
packages/builders/src/fast-discovery.ts:754-757—.jsis inFAST_DISCOVERY_SOURCE_EXTENSION_SET, so the resolver does a barefileExistsonx.jsand returnsnullwithout ever reaching the candidate-extension loop below.packages/builders/src/fast-discovery.ts:889-890— relative specifiers go through that function only; there is no enhanced-resolve fallback for them.packages/builders/src/fast-discovery.ts:24-30— the enhanced-resolve instance used for bare specifiers is constructed withoutextensionAlias, so deep package imports have the same hole.packages/builders/src/fast-discovery.ts:944-946— unresolved edges are dropped with a barereturn, no diagnostic, which is why the failure is silent.packages/builders/src/fast-discovery.test.tsuses.jsspecifiers (151, 207, 269, 765) but always against real.jsfiles on disk, so this case is untested.
Suggested fix
Contained: in resolvePathLikeSpecifier, on a .js/.jsx/.mjs/.cjs miss, retry the .ts/.tsx/.mts/.cts candidates before returning null (i.e. implement the extensionAlias semantics), and consider emitting a diagnostic when a directive-bearing edge fails to resolve instead of dropping it silently.
Impact
This hits any TypeScript library author following NodeNext module resolution — exactly the audience of the publishing-libraries cookbook. Found while building the Mastra integration (@mastra/workflow), where it cost a debugging cycle.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.