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

Running the install quickstart results in an error: TypeError: Cannot read properties of undefined (reading 'trim')

Error Message

◇ Select channel (QuickStart) │ Skip for now TypeError: Cannot read properties of undefined (reading 'trim')

Root Cause

Running the install quickstart results in an error: TypeError: Cannot read properties of undefined (reading 'trim')

Fix Action

Fixed

PR fix notes

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)

Code Example

Select channel (QuickStart)
Skip for now
TypeError: Cannot read properties of undefined (reading 'trim')
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Running the install quickstart results in an error: TypeError: Cannot read properties of undefined (reading 'trim')

Steps to reproduce

  1. Run curl -fsSL https://openclaw.ai/install.sh | bash
  2. Step though the quickstart
  3. For "Select Channel", select "Skip for now"

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

Expected behavior

Expect to complete the quickstart successfully.

Actual behavior

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

OpenClaw version

v2026.4.14

Operating system

macOS 15.7.4 (24G517)

Install method

bash

Model

openai/gpt-5.4

Provider / routing chain

n/a

Additional provider/model setup details

n/a

Logs, screenshots, and evidence

◇  Select channel (QuickStart)
│  Skip for now
TypeError: Cannot read properties of undefined (reading 'trim')

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue is likely caused by an error in the openclaw package, specifically when trying to access a property of an undefined object, and a workaround may involve checking the package's dependencies or configuration.

Guidance

  • Verify that the openclaw package is correctly installed by running bun list to check for any missing dependencies.
  • Check the openclaw documentation to ensure that the --install-daemon command is used correctly and that all required options are provided.
  • Try running the command with a specific model and channel to see if the issue is related to the model or channel selection.
  • Consider checking the package's issues on GitHub to see if others have reported similar problems.

Example

No code snippet is provided as the issue does not contain enough information to create a specific example.

Notes

The issue lacks detailed information about the error message, logs, and additional setup details, which makes it difficult to provide a more specific solution. The provided image is also not accessible, which may contain important information about the error.

Recommendation

Apply workaround: The issue is likely related to the openclaw package, and applying a workaround such as checking dependencies or configuration may help resolve the 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…

FAQ

Expected behavior

Expect to complete the quickstart successfully.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING