Skip to content

fix(test): add @standard-schema/spec to EXTERNAL_BLOCKLIST#498

Merged
Brooooooklyn merged 1 commit intomainfrom
fix-vitest-typeonly-import
Jan 24, 2026
Merged

fix(test): add @standard-schema/spec to EXTERNAL_BLOCKLIST#498
Brooooooklyn merged 1 commit intomainfrom
fix-vitest-typeonly-import

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Jan 24, 2026

@vitest/expect imports StandardSchemaV1 from @standard-schema/spec in
its type definitions only (not in JS files). Since collectLeafDependencies()
only scans .js files, this package was not detected and bundled.

Fix by adding @standard-schema/spec to EXTERNAL_BLOCKLIST and as a
runtime dependency, allowing TypeScript to resolve types through
normal node_modules resolution.

TypeCheckError: Cannot find module '@standard-schema/spec' or its corresponding type declarations.
❯ ../../node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/expect/index.d.ts:6:34


Note

Ensures @standard-schema/spec (types used by @vitest/expect) is installed and not bundled so TypeScript can resolve it while Rolldown keeps it external.

  • Add @standard-schema/spec to EXTERNAL_BLOCKLIST in build.ts and document it in BUNDLING.md
  • Declare @standard-schema/spec@^1.1.0 in packages/test/package.json; update lockfile and align @vitest/expect to use 1.1.0

This fixes missing-type errors without changing runtime code paths.

Written by Cursor Bugbot for commit 2c3a2d6. This will update automatically on new commits. Configure here.

@fengmk2 fengmk2 self-assigned this Jan 24, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Jan 24, 2026

Comment thread packages/test/package.json Outdated
Copy link
Copy Markdown
Member Author

fengmk2 commented Jan 24, 2026

@fengmk2 fengmk2 force-pushed the fix-vitest-typeonly-import branch from 6cf857b to 6455846 Compare January 24, 2026 06:49
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 24, 2026

Deploying vite-plus with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2ceacf4
Status: ✅  Deploy successful!
Preview URL: https://d0270265.vite-plus.pages.dev
Branch Preview URL: https://graphite-base-497.vite-plus.pages.dev

View logs

@fengmk2 fengmk2 force-pushed the fix-vitest-typeonly-import branch from 6455846 to 03bd974 Compare January 24, 2026 06:51
@fengmk2 fengmk2 marked this pull request as ready for review January 24, 2026 06:52
@fengmk2 fengmk2 requested review from Brooooooklyn and Copilot and removed request for Copilot January 24, 2026 06:52
Copilot AI review requested due to automatic review settings January 24, 2026 07:06
@fengmk2 fengmk2 force-pushed the fix-vitest-typeonly-import branch from 03bd974 to 2ceacf4 Compare January 24, 2026 07:06
@linear
Copy link
Copy Markdown

linear Bot commented Jan 24, 2026

VP-165 TypeCheckError: Cannot find module '@vitest/runner' or its corresponding type declarations

fengmk2/fastify-vite#3

script: vite run fastify/vite#test


Vitest caught 16 unhandled errors during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@standard-schema/spec' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/vitest/expect/index.d.ts:6:34


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/runner' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/benchmark.d.DAaHLpsq.d.ts:1:22


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/runner/utils' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/benchmark.d.DAaHLpsq.d.ts:2:35


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/runner' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/browser.d.ChKACdzH.d.ts:1:35


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/pretty-format' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/config.d.Cy95HiCx.d.ts:1:37


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/runner' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/config.d.Cy95HiCx.d.ts:2:51


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/snapshot' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/config.d.Cy95HiCx.d.ts:3:58


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/utils/diff' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/config.d.Cy95HiCx.d.ts:4:39


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/utils' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/environment.d.CrsxCzP1.d.ts:1:27


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/expect' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/global.d.B15mdLcR.d.ts:1:58


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/pretty-format' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/global.d.B15mdLcR.d.ts:2:24


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/snapshot' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/global.d.B15mdLcR.d.ts:3:31


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/runner' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/rpc.d.RH3apGEf.d.ts:1:81


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/snapshot' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/rpc.d.RH3apGEf.d.ts:2:32


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/runner' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/suite.d.BJWk38HB.d.ts:1:22


⎯⎯⎯ Unhandled Source Error ⎯⎯⎯
TypeCheckError: Cannot find module '@vitest/runner' or its corresponding type declarations.
 ❯ ../../node_modules/.pnpm/voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/voidzero-dev/vite-plus-test/dist/chunks/worker.d.Dyxm8DEL.d.ts:1:55

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a TypeScript type resolution error by properly handling @standard-schema/spec, which is imported by @vitest/expect in type definitions. The package was not detected during the build process because collectLeafDependencies() only scans .js files, causing TypeScript to fail when trying to resolve types.

Changes:

  • Added @standard-schema/spec as a runtime dependency and to the external blocklist
  • Updated pnpm-lock.yaml to use version 1.1.0 (matching @vitest/expect@4.0.17 requirements)
  • Updated BUNDLING.md documentation to reflect the new external package

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/test/package.json Added @standard-schema/spec@^1.1.0 to dependencies to ensure TypeScript can resolve types
packages/test/build.ts Added @standard-schema/spec to EXTERNAL_BLOCKLIST to prevent bundling
packages/test/BUNDLING.md Updated documentation table and code example to include the new external package
pnpm-lock.yaml Updated package resolution from version 1.0.0 to 1.1.0, consistent with @vitest/expect@4.0.17
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/test/BUNDLING.md
Comment thread packages/test/build.ts
Copy link
Copy Markdown
Member

Brooooooklyn commented Jan 24, 2026

Merge activity

  • Jan 24, 2:33 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 24, 2:34 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 24, 2:41 PM UTC: @Brooooooklyn merged this pull request with Graphite.

@vitest/expect imports StandardSchemaV1 from @standard-schema/spec in
its type definitions only (not in JS files). Since collectLeafDependencies()
only scans .js files, this package was not detected and bundled.

Fix by adding @standard-schema/spec to EXTERNAL_BLOCKLIST and as a
runtime dependency, allowing TypeScript to resolve types through
normal node_modules resolution.
@Brooooooklyn Brooooooklyn force-pushed the fix-vitest-typeonly-import branch from 2ceacf4 to 2c3a2d6 Compare January 24, 2026 14:33
@Brooooooklyn Brooooooklyn merged commit 5c97290 into main Jan 24, 2026
31 checks passed
@Brooooooklyn Brooooooklyn deleted the fix-vitest-typeonly-import branch January 24, 2026 14:41
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.

3 participants