openclaw - 💡(How to fix) Fix pnpm build fails: plugin-sdk dts TS2322 (null vs undefined) + checkServerIdentity type mismatch [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62271Fetched 2026-04-08 03:06:55
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1

Error Message

Summary\n\nRunning pnpm build fails in build:plugin-sdk:dts with TypeScript TS2322 errors:\n\n- findActiveTask expects TaskRecord | undefined but the provided functions return TaskRecord | null\n- checkServerIdentity expects () => boolean but an implementation returns Error | undefined\n\n## Environment\n\n- OS: macOS (darwin 24.4.0)\n- Node: v24.14.0\n- pnpm: 10.32.1\n- Branch: main\n- Commit: 506b4decbd86a70a3cfccb4da3e68e27d08f6ae4\n\n## Steps to reproduce\n\n\n\n## Build output (trimmed)\n\n\n\n## Expected behavior\n\npnpm build should succeed (at least through build:plugin-sdk:dts).\n\n## Notes\n\nIf maintainers prefer, I can follow up with a PR that normalizes the return types (null vs undefined) and aligns checkServerIdentity to the Node/TLS ClientOptions typing.

RAW_BUFFERClick to expand / collapse

Summary\n\nRunning pnpm build fails in build:plugin-sdk:dts with TypeScript TS2322 errors:\n\n- findActiveTask expects TaskRecord | undefined but the provided functions return TaskRecord | null\n- checkServerIdentity expects () => boolean but an implementation returns Error | undefined\n\n## Environment\n\n- OS: macOS (darwin 24.4.0)\n- Node: v24.14.0\n- pnpm: 10.32.1\n- Branch: main\n- Commit: 506b4decbd86a70a3cfccb4da3e68e27d08f6ae4\n\n## Steps to reproduce\n\n\n\n## Build output (trimmed)\n\n\n\n## Expected behavior\n\npnpm build should succeed (at least through build:plugin-sdk:dts).\n\n## Notes\n\nIf maintainers prefer, I can follow up with a PR that normalizes the return types (null vs undefined) and aligns checkServerIdentity to the Node/TLS ClientOptions typing.

extent analysis

TL;DR

The most likely fix is to update the return types of the functions to match the expected types, specifically changing TaskRecord | null to TaskRecord | undefined and Error | undefined to () => boolean.

Guidance

  • Review the findActiveTask function to ensure it returns TaskRecord | undefined instead of TaskRecord | null to resolve the TS2322 error.
  • Update the implementation of checkServerIdentity to return a function that takes no arguments and returns a boolean value, aligning with the Node/TLS ClientOptions typing.
  • Verify the changes by running pnpm build again to check if the build process succeeds through build:plugin-sdk:dts.
  • Consider creating a PR to normalize the return types and align checkServerIdentity with the expected typing, as mentioned in the issue notes.

Example

No explicit code example is provided due to the lack of specific code snippets in the issue, but the general idea is to adjust the return types of the mentioned functions to match the expected types.

Notes

The provided guidance assumes that the issue is primarily related to type mismatches and that updating the return types will resolve the TS2322 errors. However, without more detailed code or context, this is the most direct and safe suggestion based on the information given.

Recommendation

Apply workaround: Update the return types of the functions as suggested to align with the expected types, as this directly addresses the reported errors and is a straightforward step to resolve the build issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING