Skip to content

TypeError in Authentication Selection Interface #5

@OmarAfet

Description

@OmarAfet

What happened?

The Qwen Code CLI tool crashes with a TypeError when trying to select an authentication method during initial setup. When the authentication selection interface appears and the user presses Enter to select the highlighted "OpenAI" option, the CLI immediately crashes with the following error:

TypeError: Cannot read properties of undefined (reading 'value')
    at RadioButtonSelect.use_input_default.isActive (file:///Users/omarafet/.nvm/versions/node/v23.11.0/lib/node_modules/@qwen-code/qwen-code/bundle/gemini.js:261626:37)
    at file:///Users/omarafet/.nvm/versions/node/v23.11.0/lib/node_modules/@qwen-code/qwen-code/bundle/gemini.js:225665:11
    at exports3.batchedUpdates (file:///Users/omarafet/.nvm/versions/node/v23.11.0/lib/node_modules/@qwen-code/qwen-code/bundle/gemini.js:21561:16)
    at EventEmitter.handleData (file:///Users/omarafet/.nvm/versions/node/v23.11.0/lib/node_modules/@qwen-code/qwen-code/bundle/gemini.js:225664:28)
    at EventEmitter.emit (node:events:519:35)
    at ReadStream.handleReadable (file:///Users/omarafet/.nvm/versions/node/v23.11.0/lib/node_modules/@qwen-code/qwen-code/bundle/gemini.js:224959:34)
    at ReadStream.emit (node:events:507:28)
    at emitReadable_ (node:internal/streams/readable:832:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21)

Steps to reproduce:

  1. Install qwen-code via npm: npm install -g @qwen-code/qwen-code
  2. Navigate to any project directory
  3. Run qwen or qwen -y
  4. The authentication selection interface appears
  5. Press Enter to select the highlighted "OpenAI" option
  6. The CLI crashes with the TypeError

The error occurs consistently across multiple attempts and prevents any use of the CLI tool.

What did you expect to happen?

The authentication setup should proceed successfully without crashing, allowing the user to configure their authentication method and start using the CLI tool.

Client information

Details
$ qwen --version
0.0.1-alpha.7

$ qwen /about
# Command fails due to the authentication bug - cannot access /about command
# The CLI crashes during authentication setup before any commands can be executed

$ node --version
v23.11.0

$ npm --version  
11.4.2

$ npm list -g @qwen-code/qwen-code
/Users/omarafet/.nvm/versions/node/v23.11.0/lib
└── @qwen-code/qwen-code@0.0.1-alpha.7

Platform: macOS
Shell: zsh

Login information

Unable to set up login due to the bug. The error occurs during the authentication selection step before any authentication method can be configured. The CLI shows an "OpenAI" option but crashes when attempting to select it.

Anything else we need to know?

Technical Analysis:
The error suggests that in the RadioButtonSelect component, the code is trying to access items[activeIndex].value where items[activeIndex] is undefined. This indicates that either:

  1. activeIndex is out of bounds for the items array
  2. The items array is not properly initialized
  3. There's a race condition in the UI state management

Troubleshooting attempts:

  • Tried with both -y and -ay flags - same error
  • Removed and reinstalled the package completely - same error
  • Cleared npm cache and qwen configuration directory - same error
  • Tested on fresh terminal sessions - same error

Impact:
This bug prevents new users from being able to use the qwen-code CLI tool at all, as it crashes during the initial authentication setup. No workaround is currently available since the error occurs before any authentication can be configured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions