Environment
- OS: macOS
- Node Version: v22.15.1
- Package:
@clack/prompts
- Package Version: v1.0.0-alpha.0
Describe the bug
When initialValue is set, the prompts would crash with error: "TypeError: t.toLowerCase is not a function".
const result = await p.autocomplete({
message: 'Select a country',
options: countries,
placeholder: 'Type to search countries...',
maxItems: 8,
+ initialValue: 'us',
});
I think it's from one of these:
|
const label = (option.label ?? String(option.value ?? '')).toLowerCase(); |
|
const hint = (option.hint ?? '').toLowerCase(); |
|
const value = String(option.value).toLowerCase(); |
|
const term = searchText.toLowerCase(); |
To Reproduce
https://stackblitz.com/edit/node-xdxj5xxj?file=index.js
Steps to reproduce the behavior:
pnpm install
node index.js
Expected behavior
No crash happen.
Additional Information

Environment
@clack/promptsDescribe the bug
When
initialValueis set, the prompts would crash with error: "TypeError: t.toLowerCase is not a function".const result = await p.autocomplete({ message: 'Select a country', options: countries, placeholder: 'Type to search countries...', maxItems: 8, + initialValue: 'us', });I think it's from one of these:
clack/packages/prompts/src/autocomplete.ts
Lines 24 to 27 in f90f47d
To Reproduce
https://stackblitz.com/edit/node-xdxj5xxj?file=index.js
Steps to reproduce the behavior:
pnpm installnode index.jsExpected behavior
No crash happen.
Additional Information