openclaw - ✅(Solved) Fix [Bug]: Matrix TypeError: Cannot redefine property: resolveMatrixAccountStringValues [2 pull requests, 3 comments, 4 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#52780Fetched 2026-04-08 01:19:30
View on GitHub
Comments
3
Participants
4
Timeline
23
Reactions
0
Author
Timeline (top)
referenced ×12commented ×3cross-referenced ×3labeled ×2

The latest version (deployed via Docker: docker pull ghcr.io/openclaw/openclaw:main) encounters the following error upon startup:

2026-03-23T09:42:41.088+00:00 [plugins] matrix failed to load from /app/extensions/matrix/index.ts: TypeError: Cannot redefine property: resolveMatrixAccountStringValues

Error Message

The latest version (deployed via Docker: docker pull ghcr.io/openclaw/openclaw:main) encounters the following error upon startup:

Root Cause

The latest version (deployed via Docker: docker pull ghcr.io/openclaw/openclaw:main) encounters the following error upon startup:

2026-03-23T09:42:41.088+00:00 [plugins] matrix failed to load from /app/extensions/matrix/index.ts: TypeError: Cannot redefine property: resolveMatrixAccountStringValues

Fix Action

Fixed

PR fix notes

PR #3: fix(matrix): add idempotency guard to prevent duplicate registration (fixes #52780)

Description (problem / solution / changelog)

Summary

This PR fixes the "TypeError: Cannot redefine property: resolveMatrixAccountStringValues" error that occurs when loading the Matrix plugin in bundled builds.

Root Cause

The error occurs because the Matrix plugin is being loaded twice:

  1. Through the setup entry point (setup-entry.ts)
  2. Through the main plugin entry point (index.ts)

In bundled builds (tsdown), this can cause the module to be initialized twice, leading to the "Cannot redefine property" error.

Fix

Added idempotency guards in both entry files:

  1. index.ts: Added isRegistered flag to guard against duplicate registerFull() calls
  2. setup-entry.ts: Added setupInitialized flag to guard against duplicate setup() calls

Both guards log when skipping duplicate initialization.

Testing

  • The plugin should now load without the TypeError
  • Duplicate initialization attempts will be logged but safely skipped

Fixes: openclaw/openclaw#52780

Changed files

  • .agent/workflows/update_clawdbot.md (modified, +7/-7)
  • .agents/skills/openclaw-ghsa-maintainer/SKILL.md (added, +87/-0)
  • .agents/skills/openclaw-parallels-smoke/SKILL.md (added, +77/-0)
  • .agents/skills/openclaw-pr-maintainer/SKILL.md (added, +75/-0)
  • .agents/skills/openclaw-release-maintainer/SKILL.md (added, +225/-0)
  • .agents/skills/openclaw-test-heap-leaks/SKILL.md (added, +71/-0)
  • .agents/skills/openclaw-test-heap-leaks/agents/openai.yaml (added, +4/-0)
  • .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs (added, +265/-0)
  • .agents/skills/parallels-discord-roundtrip/SKILL.md (added, +62/-0)
  • .agents/skills/security-triage/SKILL.md (added, +108/-0)
  • .dockerignore (modified, +6/-0)
  • .github/CODEOWNERS (added, +54/-0)
  • .github/FUNDING.yml (removed, +0/-1)
  • .github/ISSUE_TEMPLATE/bug_report.yml (modified, +21/-25)
  • .github/actions/ensure-base-commit/action.yml (modified, +6/-2)
  • .github/actions/setup-node-env/action.yml (modified, +10/-6)
  • .github/actions/setup-pnpm-store-cache/action.yml (modified, +11/-9)
  • .github/labeler.yml (modified, +91/-14)
  • .github/pull_request_template.md (modified, +27/-1)
  • .github/workflows/auto-response.yml (modified, +43/-5)
  • .github/workflows/ci-bun.yml (added, +72/-0)
  • .github/workflows/ci.yml (modified, +488/-361)
  • .github/workflows/codeql.yml (modified, +8/-5)
  • .github/workflows/docker-release.yml (modified, +123/-40)
  • .github/workflows/install-smoke.yml (modified, +106/-27)
  • .github/workflows/labeler.yml (modified, +16/-13)
  • .github/workflows/macos-release.yml (added, +86/-0)
  • .github/workflows/openclaw-npm-release.yml (added, +171/-0)
  • .github/workflows/plugin-npm-release.yml (added, +214/-0)
  • .github/workflows/sandbox-common-smoke.yml (modified, +7/-2)
  • .github/workflows/stale.yml (modified, +12/-9)
  • .github/workflows/workflow-sanity.yml (modified, +30/-2)
  • .gitignore (modified, +18/-2)
  • .jscpd.json (added, +16/-0)
  • .npmignore (added, +2/-0)
  • .npmrc (modified, +3/-0)
  • .prettierignore (added, +1/-0)
  • .secrets.baseline (modified, +6/-6)
  • AGENTS.md (modified, +62/-142)
  • CHANGELOG.md (modified, +813/-131)
  • CONTRIBUTING.md (modified, +27/-4)
  • Dockerfile (modified, +41/-12)
  • Dockerfile.sandbox (modified, +1/-0)
  • Dockerfile.sandbox-browser (modified, +1/-0)
  • Dockerfile.sandbox-common (modified, +1/-0)
  • README.md (modified, +14/-14)
  • SECURITY.md (modified, +7/-0)
  • Swabble/Sources/SwabbleKit/WakeWordGate.swift (modified, +7/-13)
  • Swabble/Tests/SwabbleKitTests/WakeWordGateTests.swift (modified, +19/-0)
  • appcast.xml (modified, +175/-622)
  • apps/android/README.md (modified, +69/-3)
  • apps/android/app/build.gradle.kts (modified, +76/-7)
  • apps/android/app/proguard-rules.pro (modified, +0/-20)
  • apps/android/app/src/main/AndroidManifest.xml (modified, +2/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/MainActivity.kt (modified, +16/-6)
  • apps/android/app/src/main/java/ai/openclaw/app/MainViewModel.kt (modified, +170/-93)
  • apps/android/app/src/main/java/ai/openclaw/app/NodeApp.kt (modified, +12/-1)
  • apps/android/app/src/main/java/ai/openclaw/app/NodeForegroundService.kt (modified, +6/-2)
  • apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt (modified, +330/-58)
  • apps/android/app/src/main/java/ai/openclaw/app/PermissionRequester.kt (modified, +79/-21)
  • apps/android/app/src/main/java/ai/openclaw/app/SecurePrefs.kt (modified, +32/-2)
  • apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt (modified, +64/-10)
  • apps/android/app/src/main/java/ai/openclaw/app/gateway/DeviceAuthStore.kt (modified, +2/-1)
  • apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt (modified, +224/-19)
  • apps/android/app/src/main/java/ai/openclaw/app/node/A2UIHandler.kt (modified, +7/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/node/CallLogHandler.kt (added, +247/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/node/CameraCaptureManager.kt (modified, +36/-30)
  • apps/android/app/src/main/java/ai/openclaw/app/node/CameraHandler.kt (modified, +5/-3)
  • apps/android/app/src/main/java/ai/openclaw/app/node/CanvasActionTrust.kt (added, +50/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/node/CanvasController.kt (modified, +52/-14)
  • apps/android/app/src/main/java/ai/openclaw/app/node/ConnectionManager.kt (modified, +6/-2)
  • apps/android/app/src/main/java/ai/openclaw/app/node/ContactsHandler.kt (modified, +5/-2)
  • apps/android/app/src/main/java/ai/openclaw/app/node/DeviceHandler.kt (modified, +11/-2)
  • apps/android/app/src/main/java/ai/openclaw/app/node/InvokeCommandRegistry.kt (modified, +26/-5)
  • apps/android/app/src/main/java/ai/openclaw/app/node/InvokeDispatcher.kt (modified, +29/-3)
  • apps/android/app/src/main/java/ai/openclaw/app/node/LocationCaptureManager.kt (modified, +4/-9)
  • apps/android/app/src/main/java/ai/openclaw/app/node/LocationHandler.kt (modified, +75/-17)
  • apps/android/app/src/main/java/ai/openclaw/app/node/MotionHandler.kt (modified, +14/-18)
  • apps/android/app/src/main/java/ai/openclaw/app/node/PhotosHandler.kt (modified, +49/-34)
  • apps/android/app/src/main/java/ai/openclaw/app/node/SmsHandler.kt (modified, +12/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/node/SmsManager.kt (modified, +384/-1)
  • apps/android/app/src/main/java/ai/openclaw/app/protocol/OpenClawCanvasA2UIAction.kt (modified, +6/-3)
  • apps/android/app/src/main/java/ai/openclaw/app/protocol/OpenClawProtocolConstants.kt (modified, +11/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/CanvasScreen.kt (modified, +34/-3)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/ConnectTabScreen.kt (modified, +182/-76)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/GatewayConfigResolver.kt (modified, +42/-7)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/GatewayDiagnostics.kt (added, +77/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/MobileUiTokens.kt (modified, +150/-24)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt (modified, +580/-333)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/OpenClawTheme.kt (modified, +18/-1)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/PostOnboardingTabs.kt (modified, +54/-45)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/SettingsSheet.kt (modified, +320/-376)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/VoiceTabScreen.kt (modified, +48/-22)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/chat/Base64ImageState.kt (modified, +1/-4)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatComposer.kt (modified, +63/-67)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatImageCodec.kt (added, +150/-0)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMarkdown.kt (modified, +21/-17)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageListCard.kt (modified, +16/-7)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageViews.kt (modified, +11/-8)
  • apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatSheetContent.kt (modified, +27/-95)

PR #52822: fix(matrix): add idempotency guard to prevent duplicate registration (fixes #52780)

Description (problem / solution / changelog)

Summary

This PR fixes the "TypeError: Cannot redefine property: resolveMatrixAccountStringValues" error that occurs when loading the Matrix plugin in bundled builds.

Root Cause

The error occurs because the Matrix plugin is being loaded twice:

  1. Through the setup entry point (setup-entry.ts)
  2. Through the main plugin entry point (index.ts)

In bundled builds (tsdown), this can cause the module to be initialized twice, leading to the "Cannot redefine property" error.

Fix

Added idempotency guards in both entry files:

  1. index.ts: Added isRegistered flag to guard against duplicate registerFull() calls
  2. setup-entry.ts: Added setupInitialized flag to guard against duplicate setup() calls

Both guards log when skipping duplicate initialization.

Testing

  • The plugin should now load without the TypeError
  • Duplicate initialization attempts will be logged but safely skipped

Fixes: openclaw/openclaw#52780

Changed files

  • extensions/matrix/index.test.ts (modified, +1/-1)
  • extensions/matrix/index.ts (modified, +12/-1)
  • extensions/matrix/setup-entry.ts (modified, +18/-1)
  • extensions/matrix/src/runtime-api.ts (modified, +1/-3)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

The latest version (deployed via Docker: docker pull ghcr.io/openclaw/openclaw:main) encounters the following error upon startup:

2026-03-23T09:42:41.088+00:00 [plugins] matrix failed to load from /app/extensions/matrix/index.ts: TypeError: Cannot redefine property: resolveMatrixAccountStringValues

Steps to reproduce

As above

Expected behavior

The matrix works normally.

Actual behavior

As above

OpenClaw version

2026.3.22

Operating system

Ubuntu 24.04

Install method

docker

Model

minimax

Provider / routing chain

minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

The fix involves updating the matrix plugin to avoid redefining the resolveMatrixAccountStringValues property.

  • Update the index.ts file in the matrix plugin to check if the property is already defined before attempting to redefine it.
  • Use a try-catch block to handle any potential errors that may occur during the loading of the plugin.

Example Code

// index.ts
try {
  if (!globalThis.resolveMatrixAccountStringValues) {
    globalThis.resolveMatrixAccountStringValues = function() {
      // implementation
    };
  }
} catch (error) {
  console.error('Error loading matrix plugin:', error);
}

Verification

To verify that the fix worked, restart the Docker container and check the logs for any errors related to the matrix plugin. The plugin should now load successfully without encountering the TypeError.

Extra Tips

  • Make sure to update the matrix plugin to the latest version to ensure that any other potential issues are addressed.
  • Consider adding additional logging to help diagnose any future issues that may arise with the plugin.

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…

FAQ

Expected behavior

The matrix works normally.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Matrix TypeError: Cannot redefine property: resolveMatrixAccountStringValues [2 pull requests, 3 comments, 4 participants]