mirror of
https://github.com/Heretek-AI/openclaw.git
synced 2026-07-22 19:45:27 -04:00
a9ae1a6778
Matrix Protocol: - docker-compose.matrix.yml: Dendrite homeserver + PostgreSQL + Nginx TLS - src/channels/plugins/matrix-channel.ts: OpenClaw plugin implementation - docs/matrix-triad-setup.md: Setup guide with auth scheme (@tm1-4:triad.local) MCP Server Integration: - docs/mcp-triad-integration.md: SearXNG, Playwright, GitHub MCP configs - docs/mcp-curiosity-mapping.md: Gap-to-capability mapping Node Sync Architecture: - src/services/node-sync-service.ts: WebSocket peer sync + presence detection - src/services/node-sync-service.test.ts: Unit tests - docs/node-sync-architecture.md: Architecture docs Triad Resilience: - scripts/triad-corruption-check.mjs: SQLite + log + config + git integrity - docs/triad-resilience.md: Recovery procedures - .secure/deployment-logs/README.md: Schema v2 - skills/triad-heartbeat/SKILL.md: Corruption check integration NPM Publish Workflow: - scripts/npm-publish.mjs: version, changelog, validate, publish, rollback - .github/workflows/npm-publish.yml: GitHub Actions with provenance - docs/npm-publish-guide.md: Complete documentation All deliverables tested in Docker before production.
2.8 KiB
Executable File
2.8 KiB
Executable File
summary, read_when, title
| summary | read_when | title | ||
|---|---|---|---|---|
| Node + tsx "__name is not a function" crash notes and workarounds |
|
Node + tsx Crash |
Node + tsx "__name is not a function" crash
Summary
Running OpenClaw via Node with tsx fails at startup with:
[openclaw] Failed to start CLI: TypeError: __name is not a function
at createSubsystemLogger (.../src/logging/subsystem.ts:203:25)
at .../src/agents/auth-profiles/constants.ts:25:20
This began after switching dev scripts from Bun to tsx (commit 2871657e, 2026-01-06). The same runtime path worked with Bun.
Environment
- Node: v25.x (observed on v25.3.0)
- tsx: 4.21.0
- OS: macOS (repro also likely on other platforms that run Node 25)
Repro (Node-only)
# in repo root
node --version
pnpm install
node --import tsx src/entry.ts status
Minimal repro in repo
node --import tsx scripts/repro/tsx-name-repro.ts
Node version check
- Node 25.3.0: fails
- Node 22.22.0 (Homebrew
node@22): fails - Node 24: not installed here yet; needs verification
Notes / hypothesis
tsxuses esbuild to transform TS/ESM. esbuild’skeepNamesemits a__namehelper and wraps function definitions with__name(...).- The crash indicates
__nameexists but is not a function at runtime, which implies the helper is missing or overwritten for this module in the Node 25 loader path. - Similar
__namehelper issues have been reported in other esbuild consumers when the helper is missing or rewritten.
Regression history
2871657e(2026-01-06): scripts changed from Bun to tsx to make Bun optional.- Before that (Bun path),
openclaw statusandgateway:watchworked.
Workarounds
-
Use Bun for dev scripts (current temporary revert).
-
Use Node + tsc watch, then run compiled output:
pnpm exec tsc --watch --preserveWatchOutput node --watch openclaw.mjs status -
Confirmed locally:
pnpm exec tsc -p tsconfig.json+node openclaw.mjs statusworks on Node 25. -
Disable esbuild keepNames in the TS loader if possible (prevents
__namehelper insertion); tsx does not currently expose this. -
Test Node LTS (22/24) with
tsxto see if the issue is Node 25–specific.
References
- https://opennext.js.org/cloudflare/howtos/keep_names
- https://esbuild.github.io/api/#keep-names
- https://github.com/evanw/esbuild/issues/1031
Next steps
- Repro on Node 22/24 to confirm Node 25 regression.
- Test
tsxnightly or pin to earlier version if a known regression exists. - If reproduces on Node LTS, file a minimal repro upstream with the
__namestack trace.