fix(web): transpile @preflight/runreport, unblocking the deploy build #507

Closed
gmackie wants to merge 1 commit from fix/transpile-runreport into main
Owner

Second layer of the same outage. #505 fixed the registry 401 so @preflight/runreport installs — and the deploy build immediately fails on the next thing:

./node_modules/@preflight/runreport/src/index.ts
Error: Unknown module type

Root cause is in the package, not here. It publishes a compiled dist/ and an exports map pointing at source:

"main":    "./dist/index.js",
"types":   "./dist/index.d.ts",
"exports": { ".": "./src/index.ts" }

exports takes precedence over main, so every resolver — Turbopack, Node, tsc — gets raw TypeScript even though a correct compiled build sits right there.

Adding it to transpilePackages, alongside the workspace packages that also ship TS source, lets Turbopack compile it. This is a consumer-side unblock, not the real fix — @preflight/runreport should publish exports: { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, after which this line can come back out.

Verified locally rather than merge-and-hope, since this pipeline has already burned several cycles: next build compiles successfully, 205 static pages — the exact step failing on main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMpzX1b6swjezEptw3T71f

Second layer of the same outage. #505 fixed the registry 401 so `@preflight/runreport` installs — and the deploy build immediately fails on the next thing: ``` ./node_modules/@preflight/runreport/src/index.ts Error: Unknown module type ``` **Root cause is in the package, not here.** It publishes a compiled `dist/` *and* an exports map pointing at source: ```json "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { ".": "./src/index.ts" } ``` `exports` takes precedence over `main`, so every resolver — Turbopack, Node, tsc — gets raw TypeScript even though a correct compiled build sits right there. Adding it to `transpilePackages`, alongside the workspace packages that also ship TS source, lets Turbopack compile it. **This is a consumer-side unblock, not the real fix** — `@preflight/runreport` should publish `exports: { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }`, after which this line can come back out. **Verified locally rather than merge-and-hope**, since this pipeline has already burned several cycles: `next build` compiles successfully, 205 static pages — the exact step failing on main. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01CMpzX1b6swjezEptw3T71f
fix(web): transpile @preflight/runreport, unblocking the deploy build
All checks were successful
CI / gitleaks (pull_request) Successful in 9s
CI / storybook (pull_request) Successful in 1m56s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 9m53s
e34bf7fb1f
With the registry 401 fixed by #505, @preflight/runreport installs — and
the next thing breaks: the deploy build fails with

  ./node_modules/@preflight/runreport/src/index.ts
  Error: Unknown module type

The package publishes a compiled dist/ AND an exports map pointing at
source:

  main:    "./dist/index.js"
  exports: { ".": "./src/index.ts" }

exports wins over main, so every resolver gets raw TypeScript. Adding it
to transpilePackages — where the workspace packages that also ship TS
already live — lets Turbopack compile it.

This is a consumer-side unblock, not the real fix: the package should
export dist/. Filed as such so main can deploy again.

Verified locally: next build compiles successfully, 205 static pages —
the same step that was failing on main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMpzX1b6swjezEptw3T71f
Author
Owner

Superseded by #509. The package was fixed at source and republished as 0.1.2, so transpiling it here is no longer needed and would only mask a future regression.

Verified the published artifacts directly rather than taking it on trust:

0.1.1 exports: {".":"./src/index.ts"}
0.1.2 exports: {".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}

One correction to this PR body for the record: I wrote that the package published a bad exports map, implying its manifest was wrong. It was not. The repo manifest always carried the correct map under publishConfig.exports — but npm publish ignores publishConfig.exports while pnpm publish applies it, so the published artifact and the source disagreed. Reading the repo would have told me nothing. npm view <pkg>@<ver> exports is what settles it.

Closing unmerged.

Superseded by #509. The package was fixed at source and republished as 0.1.2, so transpiling it here is no longer needed and would only mask a future regression. Verified the published artifacts directly rather than taking it on trust: ``` 0.1.1 exports: {".":"./src/index.ts"} 0.1.2 exports: {".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}} ``` One correction to this PR body for the record: I wrote that the package published a bad exports map, implying its manifest was wrong. It was not. The repo manifest always carried the correct map under `publishConfig.exports` — but `npm publish` ignores `publishConfig.exports` while `pnpm publish` applies it, so the published artifact and the source disagreed. Reading the repo would have told me nothing. `npm view <pkg>@<ver> exports` is what settles it. Closing unmerged.
gmackie closed this pull request 2026-08-27 22:31:23 +00:00
All checks were successful
CI / gitleaks (pull_request) Successful in 9s
Required
Details
CI / storybook (pull_request) Successful in 1m56s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 9m53s
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gmackie/ForgeGraph!507
No description provided.