openclaw - ✅(Solved) Fix [Bug]: While onboarding:TypeError: Cannot read properties of undefined (reading 'trim') [2 pull requests, 6 comments, 7 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#66693Fetched 2026-04-15 06:24:53
View on GitHub
Comments
6
Participants
7
Timeline
17
Reactions
0
Author
Timeline (top)
commented ×6cross-referenced ×6subscribed ×3labeled ×1

Summary

OpenClaw 2026.4.14 (323493f) crashes during onboarding immediately after “Select channel (QuickStart)” with:

TypeError: Cannot read properties of undefined (reading 'trim')

Environment

  • OpenClaw: 2026.4.14 (323493f)
  • OS: Ubuntu 24.04
  • Hardware: ODROID-H4

Repro

  1. Start onboarding
  2. Reach “Select channel (QuickStart)”
  3. Either:
    • choose any channel, or
    • select “Skip for now”
  4. Continue

Actual result

Onboarding crashes with:

TypeError: Cannot read properties of undefined (reading 'trim')

Expected result

Onboarding should continue normally after channel selection or “Skip for now”.

Notes

  • This happens regardless of model or channel choice.
  • Earlier the same day, onboarding worked once from a fresh global npm install + onboard flow.
  • The repeated failures started only after I reset/reinstalled while trying to switch providers.
  • The successful path and failing path may differ by install method:
    • worked once with a fresh global npm install + openclaw onboard
    • later failing attempts used the curl/docs install path
  • After the failed onboarding attempts, logs also show: Gateway start blocked: existing config is missing gateway.mode
  • This may indicate a broader 2026.4.14 onboarding regression, possibly followed by config clobbering.

Related issues

  • #66641
  • #66619

Logs / evidence

Root Cause

Summary

OpenClaw 2026.4.14 (323493f) crashes during onboarding immediately after “Select channel (QuickStart)” with:

TypeError: Cannot read properties of undefined (reading 'trim')

Environment

  • OpenClaw: 2026.4.14 (323493f)
  • OS: Ubuntu 24.04
  • Hardware: ODROID-H4

Repro

  1. Start onboarding
  2. Reach “Select channel (QuickStart)”
  3. Either:
    • choose any channel, or
    • select “Skip for now”
  4. Continue

Actual result

Onboarding crashes with:

TypeError: Cannot read properties of undefined (reading 'trim')

Expected result

Onboarding should continue normally after channel selection or “Skip for now”.

Notes

  • This happens regardless of model or channel choice.
  • Earlier the same day, onboarding worked once from a fresh global npm install + onboard flow.
  • The repeated failures started only after I reset/reinstalled while trying to switch providers.
  • The successful path and failing path may differ by install method:
    • worked once with a fresh global npm install + openclaw onboard
    • later failing attempts used the curl/docs install path
  • After the failed onboarding attempts, logs also show: Gateway start blocked: existing config is missing gateway.mode
  • This may indicate a broader 2026.4.14 onboarding regression, possibly followed by config clobbering.

Related issues

  • #66641
  • #66619

Logs / evidence

Fix Action

Fixed

PR fix notes

PR #66727: fix: guard against undefined path in formatDocsLink

Description (problem / solution / changelog)

Summary

Fix TypeError crash in openclaw configure and onboarding when channel docs path is undefined.

Root Cause

formatChannelSelectionLine passes meta.docsPath to formatDocsLink, but docsPath can be undefined for some channels. formatDocsLink calls path.trim() on the undefined value, throwing TypeError: Cannot read properties of undefined (reading 'trim').

Fix

Added nullish coalescing guard (path ?? "") and early return with fallback when trimmed result is empty.

Test Plan

  • openclaw configure wizard no longer crashes on channels without docsPath
  • Onboarding channel selection no longer crashes
  • Existing formatDocsLink callers continue to work

Closes openclaw#66718 Closes openclaw#66693

Changed files

  • src/terminal/links.ts (modified, +5/-3)

PR #66882: fix(wizard): guard text-input prompts against undefined clack results

Description (problem / solution / changelog)

Summary

Fixes the widespread onboarding crash:

TypeError: Cannot read properties of undefined (reading 'trim')

that kills openclaw onboard / openclaw configure during channel selection and channel-specific text-input steps (Telegram, Slack, Discord, etc.).

Root cause

@clack/prompts text() can resolve to undefined in some edge cases (e.g. submitting an empty value when neither initialValue nor placeholder is set), even though WizardPrompter.text is declared as Promise<string>. The wrapper in src/wizard/clack-prompter.ts passes the value through guardCancel but does not coerce the non-cancel path, so undefined leaks out to callers. buildChannelSetupWizardAdapterFromSetupWizard in src/channels/plugins/setup-wizard.ts then calls rawValue.trim() directly and crashes.

Fix

  • src/wizard/clack-prompter.ts — enforce the declared Promise<string> contract by coercing nullish results to "" after guardCancel. This covers every prompter.text caller in one place.
  • src/channels/plugins/setup-wizard.ts — belt-and-suspenders rawValue ?? "" at the existing call site so the same symptom can't be reintroduced by a future prompter swap.
  • src/wizard/clack-prompter.test.ts — unit tests for the wrapper covering both the undefined → "" coercion and the string passthrough.

Related issues

  • #66693 [Bug]: While onboarding: TypeError: Cannot read properties of undefined (reading 'trim')
  • #66718 [Bug] openclaw configure TypeError: Cannot read properties of undefined (reading 'trim')
  • #66848 [Bug]: TypeError: Cannot read properties of undefined (reading 'trim')
  • #66677 [Bug]: Select channel (QuickStart)
  • #66624 (closed) same symptom, v2026.4.14
  • #66728 (closed) Skip for now variant
  • #66641 (closed) installer crashes after Select channel (QuickStart)
  • #66619 (closed) Telegram setup variant

Test plan

  • New unit tests in src/wizard/clack-prompter.test.ts pass locally against the patched wrapper.
  • CI: pnpm test:unit / channel plugin tests.
  • Manual: openclaw onboard, pick Telegram, step through the text-input steps without hitting the TypeError.

Changed files

  • src/channels/plugins/setup-wizard-helpers.ts (modified, +7/-7)
  • src/channels/plugins/setup-wizard.ts (modified, +1/-1)
  • src/wizard/clack-prompter.test.ts (modified, +40/-2)
  • src/wizard/clack-prompter.ts (modified, +7/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Summary

OpenClaw 2026.4.14 (323493f) crashes during onboarding immediately after “Select channel (QuickStart)” with:

TypeError: Cannot read properties of undefined (reading 'trim')

Environment

  • OpenClaw: 2026.4.14 (323493f)
  • OS: Ubuntu 24.04
  • Hardware: ODROID-H4

Repro

  1. Start onboarding
  2. Reach “Select channel (QuickStart)”
  3. Either:
    • choose any channel, or
    • select “Skip for now”
  4. Continue

Actual result

Onboarding crashes with:

TypeError: Cannot read properties of undefined (reading 'trim')

Expected result

Onboarding should continue normally after channel selection or “Skip for now”.

Notes

  • This happens regardless of model or channel choice.
  • Earlier the same day, onboarding worked once from a fresh global npm install + onboard flow.
  • The repeated failures started only after I reset/reinstalled while trying to switch providers.
  • The successful path and failing path may differ by install method:
    • worked once with a fresh global npm install + openclaw onboard
    • later failing attempts used the curl/docs install path
  • After the failed onboarding attempts, logs also show: Gateway start blocked: existing config is missing gateway.mode
  • This may indicate a broader 2026.4.14 onboarding regression, possibly followed by config clobbering.

Related issues

  • #66641
  • #66619

Logs / evidence

Steps to reproduce

  1. Install OpenClaw 2026.4.14 (323493f).
  2. Run openclaw onboard.
  3. Continue through onboarding normally.
  4. Reach the step: “Select channel (QuickStart)”.
  5. Either:
    • select any channel, or
    • select “Skip for now”.
  6. Continue onboarding.

Expected behavior

Onboarding should continue to the next step normally after channel selection or “Skip for now”, finish setup, and leave a valid config.

Actual behavior

Onboarding immediately crashes with:

TypeError: Cannot read properties of undefined (reading 'trim')

This happens regardless of which model or channel I choose. In my case, repeated failed attempts also later left the gateway in a bad config state, with logs showing:

Gateway start blocked: existing config is missing gateway.mode

OpenClaw version

2026.4.14 (323493f)

Operating system

Ubuntu 24.04 / ODROID-H4

Install method

curl/docs installer for the failing repros (earlier the same day it worked once with a fresh global npm install)

Model

deepseek-chat (also reproduced regardless of model choice)

Provider / routing chain

deepseek (also reproduced regardless of provider/channel choice)

Additional provider/model setup details

Note: this also appears to be model-independent, and an earlier successful run happened via a fresh global npm install.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The most likely fix is to investigate and resolve the TypeError: Cannot read properties of undefined (reading 'trim') error, potentially related to the onboarding process and configuration handling in OpenClaw 2026.4.14.

Guidance

  • Review the onboarding code to identify where the trim() function is being called on an undefined object, potentially related to user input or configuration data.
  • Verify that the gateway.mode configuration is properly set during onboarding, as the error Gateway start blocked: existing config is missing gateway.mode suggests a configuration issue.
  • Compare the differences between the fresh global npm install and the curl/docs install method to identify potential discrepancies in the installation or configuration process.
  • Check the related issues #66641 and #66619 for potential clues or fixes related to the onboarding regression.

Example

No specific code example can be provided without more context, but the error suggests that there may be an issue with how user input or configuration data is being handled during the onboarding process.

Notes

The fact that the issue is reproducible regardless of model or channel choice suggests a more fundamental issue with the onboarding process. The successful run with a fresh global npm install earlier in the day may indicate a transient issue or a difference in the installation process.

Recommendation

Apply a workaround by manually setting the gateway.mode configuration during onboarding, if possible, to see if it resolves the Gateway start blocked error and allows the onboarding process to continue. This may help identify if the issue is related to the configuration handling or a more fundamental problem with the onboarding code.

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

Onboarding should continue to the next step normally after channel selection or “Skip for now”, finish setup, and leave a valid config.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING