openclaw - ✅(Solved) Fix onboard TypeError: Cannot read properties of undefined (reading 'trim') [1 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#67516Fetched 2026-04-17 08:30:27
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
1
Timeline (top)
cross-referenced ×3commented ×2closed ×1referenced ×1

Error Message

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

Fix Action

Workaround

The config file is written correctly before the crash. Running openclaw gateway start afterwards works as expected.

PR fix notes

PR #67531: fix: guard against undefined trim() crashes in onboard QuickStart flow

Description (problem / solution / changelog)

Summary

Fixes #67516 — TypeError: Cannot read properties of undefined (reading 'trim') crash during openclaw onboard QuickStart flow after the channel selection step.

Problem

The QuickStart flow skips certain configuration steps (e.g. plugin config via setupPluginConfig), which means values that downstream code expects to be populated strings may be undefined. Several .trim() calls in the post-channel-setup code path do not guard against this.

Changes

Adds defensive (value ?? "").trim() guards to all .trim() calls in the QuickStart onboarding code path:

FileChange
src/wizard/setup.tsworkspaceInput resolution
src/commands/onboard-helpers.tsprobeGatewayReachable URL param
src/commands/onboard-custom.tsbaseUrl params in verification & setup
src/agents/skills-install.tsInstall stdout/stderr handling
src/plugins/provider-model-helpers.tsModel ID resolution

All changes are no-op when values are already strings (the common case), but prevent crashes when a value is undefined due to skipped config steps.

Testing

  • Verified the fix compiles against the current codebase
  • Each guard preserves existing behavior when values are present

Changed files

  • src/agents/skills-install.ts (modified, +2/-2)
  • src/commands/onboard-custom.ts (modified, +5/-5)
  • src/commands/onboard-helpers.ts (modified, +1/-1)
  • src/plugins/provider-model-helpers.ts (modified, +1/-1)
  • src/wizard/setup.ts (modified, +1/-1)
RAW_BUFFERClick to expand / collapse

Bug

openclaw onboard crashes with TypeError: Cannot read properties of undefined (reading 'trim') at the end of the QuickStart channel selection step.

Steps to Reproduce

  1. Run openclaw onboard on a fresh install (or with existing config)
  2. Complete security, setup mode, model/auth steps normally
  3. At "Select channel (QuickStart)":
    • Choosing "Skip for now" → crash
    • Choosing a channel (e.g. Feishu) and completing setup → "Bot configured" + "client ready" printed, then crash
  4. Error: TypeError: Cannot read properties of undefined (reading 'trim')

Environment

  • OpenClaw version: 2026.4.14 (323493f)
  • Node: v22.22.2
  • OS: Ubuntu, Linux 6.8.0-31-generic (x64)
  • Channel: Feishu (scan-to-create)
  • Model: zai/glm-5.1 (coding-cn endpoint)

Expected Behavior

Onboard completes or exits gracefully after channel step.

Actual Behavior

Crashes with TypeError. The channel configuration itself seems to be written correctly (Feishu bot shows "client ready" before crash).

Workaround

The config file is written correctly before the crash. Running openclaw gateway start afterwards works as expected.

extent analysis

TL;DR

The openclaw onboard process crashes due to a TypeError when trying to read properties of an undefined object, suggesting an issue with the handling of user input or configuration data during the QuickStart channel selection step.

Guidance

  • Verify that the error occurs consistently when choosing "Skip for now" or after completing the channel setup, to confirm if the issue is related to the input handling or the configuration writing process.
  • Check the configuration file written before the crash to ensure it is correctly formatted and contains all necessary properties, as the fact that openclaw gateway start works afterwards suggests the config itself might not be the primary issue.
  • Investigate the code handling the "Skip for now" option and the channel setup completion to identify where the undefined object is being accessed, focusing on any trim() method calls.
  • Consider adding error handling or logging around the suspected code area to provide more insight into the variables and objects involved when the error occurs.

Example

No specific code example can be provided without access to the openclaw source code, but the investigation should focus on areas where user input is processed or configuration data is accessed, looking for any potential null or undefined checks that might be missing.

Notes

The solution to this issue may require modifications to the openclaw codebase, specifically in how it handles user input during the onboarding process or how it manages configuration data. Without direct access to the code, pinpointing the exact fix is challenging.

Recommendation

Apply a workaround by manually inspecting and potentially correcting the configuration file after the crash, then use openclaw gateway start to proceed, as this allows for continued use of the application while the root cause is investigated.

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