Skip to content

test:temporal-polyfill fails with TS2688: consumer project cannot resolve @types/node #1026

Description

@2chanhaeng

mise run --skip-deps test:temporal-polyfill fails on a fresh checkout in both TypeScript consumer checks:

error TS2688: Cannot find type definition file for 'node'.
    Entry point of type library 'node' specified in compilerOptions

Cause

scripts/check_temporal_polyfill.ts generates a consumer project under tmp/ with types: ["node"] but only symlinks @fedify/* into its node_modules. TypeScript resolves types from node_modules/@types in the project directory and its ancestors, and no such directory exists: the root package.json has no dependencies, pnpm hoists privately into node_modules/.pnpm/node_modules, and deno.json sets nodeModulesDir: "none". The check therefore passes only where an ancestor directory happens to contain @types/node. The task is not run in CI, so this was never caught.

Related problems

  • @fedify/fedify declares @types/node@^24.2.1 while the pnpm catalog pins ^22.17.0. The locked 24.3.0 conflicts with TypeScript 6.0's lib.dom on URLPattern (TS2403 with skipLibCheck: false); 22.19.1 and 24.12.2 pass.
  • findTypeScriptCompiler() picks the first typescript@* entry in readDir order. The .deno store holds 5.9.3, 6.0.3, and 7.0.2; with 5.9.3 the esnext.temporal lib is missing and 806 errors follow.

Proposed fix

  • Symlink the catalog @types/node into the consumer project (or set typeRoots).
  • Align the @types/node range in @fedify/fedify with the catalog.
  • Sort compiler candidates by version and require TypeScript 6.0 or later.
  • Run test:temporal-polyfill in CI.

Disclosure: drafted with Claude Code (Claude Fable 5.1), reviewed and edited by a human before submission.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions