openclaw - ✅(Solved) Fix [Bug]: TypeError: Cannot read properties of undefined (reading 'trim') on QuickStart [3 pull requests, 6 comments, 5 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#67649Fetched 2026-04-17 08:30:00
View on GitHub
Comments
6
Participants
5
Timeline
23
Reactions
0
Timeline (top)
referenced ×11commented ×6cross-referenced ×3labeled ×2

QuickStart wizard crashes with TypeError after showing Telegram DM warning, regardless of channel selected.

Error Message

  1. Error appears after DM access warning is shown

Root Cause

QuickStart wizard crashes with TypeError after showing Telegram DM warning, regardless of channel selected.

Fix Action

Fixed

PR fix notes

PR #67663: fix(wizard): guard undefined prompt return values in setup helpers

Description (problem / solution / changelog)

Summary

Fixes #67649 — QuickStart wizard crashes with TypeError: Cannot read properties of undefined (reading 'trim') after showing the DM access warning.

Root Cause

Commit e1a350d08e ("refactor: remove redundant setup helper conversions") removed String() wrappers around prompter.text() return values. However, @clack/prompts text() can return undefined in edge cases rather than an empty string. The removed String() calls had been silently converting undefined to the string "undefined", preventing the crash.

Changes

  • src/channels/plugins/setup-wizard-helpers.ts — Restore runtime safety at 5 call sites where prompter.text() results are consumed. Instead of reverting to String() (which turns undefined into "undefined"), use typeof guards that fall back to empty string. Same pattern used in #67086.
  • src/channels/plugins/setup-wizard.ts — Guard rawValue.trim() in the text input step against non-string return values.
  • src/channels/plugins/setup-wizard-helpers.test.ts — Add regression test: verify promptSingleChannelToken does not throw TypeError when prompter.text() returns undefined at runtime.

Testing

  • pnpm test src/channels/plugins/setup-wizard-helpers.test.ts — 89 passed (including the new regression test), 1 pre-existing timeout (unrelated patchChannelConfigForAccount test).

Changed files

  • src/channels/plugins/setup-wizard-helpers.test.ts (modified, +55/-0)
  • src/channels/plugins/setup-wizard-helpers.ts (modified, +12/-7)
  • src/channels/plugins/setup-wizard.ts (modified, +2/-0)

PR #67694: fix(ui): ensure markdown-it-task-lists is bundled by Vite [AI-assisted]

Description (problem / solution / changelog)

Summary

Fixes #67680 — Control UI renders a blank page because the Vite production bundle contains an unresolved bare module specifier for markdown-it-task-lists.

Root Cause

The markdown-it-task-lists package is declared in ui/package.json but the build pre-flight check in scripts/ui.js only validates vite and dompurify. If markdown-it-task-lists is not installed (e.g., incomplete pnpm install in CI), Vite cannot resolve the import and emits a bare specifier in the output bundle. Browsers cannot load bare specifiers, causing the entire UI to crash.

Fix

  1. scripts/ui.js: Add markdown-it-task-lists to the depsInstalled() pre-flight check. If the package is missing, pnpm install runs automatically before vite build.
  2. ui/vite.config.ts: Add markdown-it-task-lists to optimizeDeps.include for consistent pre-bundling.

Changed Files

  • scripts/ui.js — 1 line added (require.resolve('markdown-it-task-lists'))
  • ui/vite.config.tsoptimizeDeps.include extended

Testing

  • Verified require.resolve('markdown-it-task-lists') resolves correctly from ui/package.json
  • Existing ui/src/ui/markdown.test.ts covers task list rendering

Closes #67680

[!NOTE] This PR also contains the wizard guard fix from #67663 (shared base branch). GitHub will auto-deduplicate when either is merged first.


[!NOTE] This contribution was made with the assistance of AI tools (Antigravity).

Changed files

  • scripts/ui.js (modified, +1/-0)
  • ui/vite.config.ts (modified, +1/-1)

PR #67802: Fix: [Bug]: TypeError: Cannot read properties of undefi

Description (problem / solution / changelog)

This PR fixes the issue described in #67649.

Closes #67649

Changed files

  • CONTRIBUTORS_AUTO.md (added, +1/-0)

Code Example

https://drive.google.com/file/d/1W5M5JDolAL9t4Wt0r9_78fXT6I-xw2Rm/view?usp=sharing
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

QuickStart wizard crashes with TypeError after showing Telegram DM warning, regardless of channel selected.

Steps to reproduce

  1. Run openclaw
  2. Select any channel (telegram or "Skip for now")
  3. Error appears after DM access warning is shown

Expected behavior

Setup wizard should continue normally after the warning.

Actual behavior

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

OpenClaw version

2026.4.14

Operating system

Debian Linux(Debian 13)

Install method

npm global

Model

NOT_ENOUGH_INFO

Provider / routing chain

NOT_ENOUGH_INFO

Additional provider/model setup details

NOT_ENOUGH_INFO

Logs, screenshots, and evidence

https://drive.google.com/file/d/1W5M5JDolAL9t4Wt0r9_78fXT6I-xw2Rm/view?usp=sharing

Impact and severity

NOT_ENOUGH_INFO

Additional information

NOT_ENOUGH_INFO

extent analysis

TL;DR

The QuickStart wizard crash with a TypeError after showing the Telegram DM warning may be due to an undefined property being accessed, and checking the code for any recent changes or updates related to the trim() function call could help identify the issue.

Guidance

  • Review the code changes made between the previous working version and the current version (2026.4.14) to identify any modifications that could be causing the TypeError: Cannot read properties of undefined (reading 'trim') error.
  • Investigate the openclaw command and the QuickStart wizard's implementation to understand how the trim() function is being used and what object it is being called on.
  • Check the provided logs and evidence (https://drive.google.com/file/d/1W5M5JDolAL9t4Wt0r9_78fXT6I-xw2Rm/view?usp=sharing) for any additional error messages or clues that could help pinpoint the issue.
  • Consider adding error handling or checks to ensure that the object being accessed is defined before calling the trim() function.

Example

No specific code example can be provided without more information about the implementation, but a general example of how to safely call the trim() function could be:

if (typeof myObject.myProperty !== 'undefined') {
  myObject.myProperty = myObject.myProperty.trim();
}

Notes

The lack of information about the provider/model setup, routing chain, and impact/severity makes it challenging to provide a more specific solution. Additional details about the code and implementation would be necessary to provide a more accurate fix.

Recommendation

Apply workaround: Add error handling to ensure that the object being accessed is defined before calling the trim() function, as this is a more immediate and safe solution given the limited information available.

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

Setup wizard should continue normally after the warning.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING