Skip to content

Fix npm run check failing on a clean clone - #70

Open
rafaelfiguereod-stack wants to merge 1 commit into
diffusionstudio:mainfrom
rafaelfiguereod-stack:fix/check-missing-file-system-access-types
Open

rafaelfiguereod-stack wants to merge 1 commit into
diffusionstudio:mainfrom
rafaelfiguereod-stack:fix/check-missing-file-system-access-types

Conversation

@rafaelfiguereod-stack

Copy link
Copy Markdown

What

npm run check, the typecheck gate the README asks for before sending a PR, fails on a fresh clone of main. Three workspaces report the same error:

../assets/src/browser.ts(65,25): error TS2339: Property 'showSaveFilePicker'
does not exist on type 'Window & typeof globalThis'.

@diffusionstudio/encoder, @diffusionstudio/reconciler and @diffusionstudio/runtime fail. The other eight workspaces pass.

Why

packages/assets/src/browser.ts calls window.showSaveFilePicker, which is typed by @types/wicg-file-system-access. That package is declared only in apps/web, and pulled in there through types in tsconfig.app.json.

The three failing packages pin types in their own tsconfigs (["@webgpu/types"], plus @types/audioworklet for the encoder). Pinning types turns off automatic inclusion of every other @types package, so the global augmentation is not in their program when they typecheck the assets source they import.

packages/assets itself passes, but only by accident: it does not pin types, so it picks up the hoisted copy that the apps/web install put in the root node_modules.

The fix

Two lines plus a lockfile entry.

A triple-slash reference in the file that uses the API. types only governs automatic inclusion, so an explicit reference resolves regardless of what a consumer pins. This matches the existing style in apps/web/src/vite-env.d.ts.

The package declared in packages/assets, so the workspace that uses the API owns its type dependency instead of leaning on another workspace's install.

Adding the package alone does not fix it. I checked: with the dependency installed but the reference removed, the encoder still fails, because its types pin keeps the augmentation out either way.

Verified

On Windows, Node 24.1.0, npm 11.3.0, at b317412.

  • npm run check: clean across all eleven workspaces, was three failures
  • npm run lint: unchanged, 0 errors and the same 3 pre-existing warnings
  • npm test: 131 passed across the three workspaces that have tests

One unrelated note in case it is useful: packages/agent-chat's "interrupts a running turn and records what was streamed" e2e test failed once under a full npm test run and then passed 3 of 3 on its own, so it looks timing sensitive under load rather than broken.

🤖 Generated with Claude Code

packages/assets/src/browser.ts calls window.showSaveFilePicker, which is
typed by @types/wicg-file-system-access. Only apps/web declared that
package, and the encoder, reconciler and runtime tsconfigs pin "types",
which turns off automatic @types inclusion. All three then fail to
typecheck the assets source they import:

  ../assets/src/browser.ts(65,25): error TS2339: Property
  'showSaveFilePicker' does not exist on type 'Window & typeof globalThis'.

packages/assets itself passes only because it does not pin "types", so it
picks the hoisted copy up from the apps/web install.

Add a triple-slash reference in the file that uses the API, so the type
resolves whatever a consumer pins, and declare the package in
packages/assets so it no longer leans on another workspace's install.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

@rafaelfiguereod-stack is attempting to deploy a commit to the Diffusion Studio Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant