I had a weird error that is caused from cmdk library.
Currently, the documentation does not warn about cmdk@1.0.0 version just telling to install the latest version,
and I get this error.
chunk-XY2OZXVN.js?v=92362472:16659 Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at Function.from (<anonymous>)
at A (cmdk.js?v=599d1b8c:171:18)
at U2 (cmdk.js?v=599d1b8c:137:13)
at cmdk.js?v=599d1b8c:97:34
at cmdk.js?v=599d1b8c:365:31
at Map.forEach (<anonymous>)
at cmdk.js?v=599d1b8c:365:15
at commitHookEffectListMount (chunk-XY2OZXVN.js?v=92362472:16904:34)
at commitLayoutEffectOnFiber (chunk-XY2OZXVN.js?v=92362472:16992:23)
at commitLayoutMountEffects_complete (chunk-XY2OZXVN.js?v=92362472:17976:17)
I tried to change the version to direct previous version, and it work as expected.
Affected component/components
Combobox, Command
How to reproduce
installation for reproduction project - following this
✔ Would you like to use TypeScript (recommended)? … yes
✔ Which style would you like to use? › Default
✔ Which color would you like to use as base color? › Zinc
✔ Where is your global CSS file? … src/globals.css
✔ Would you like to use CSS variables for colors? … yes
✔ Are you using a custom tailwind prefix eg. tw-? (Leave blank if not) …
✔ Where is your tailwind.config.js located? … tailwind.config.js
✔ Configure the import alias for components: … @/components
✔ Configure the import alias for utils: … @/lib/utils
✔ Are you using React Server Components? … no
✔ Write configuration to components.json. Proceed? … yes
Now you can see a combo box in the page, but when you click it, it crash the app with the error message:
```console
chunk-B27YY5WJ.js?v=2667d1d7:16691 Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at Function.from (<anonymous>)
at A (cmdk.js?v=aa178e46:171:18)
at U2 (cmdk.js?v=aa178e46:137:13)
at cmdk.js?v=aa178e46:97:34
at cmdk.js?v=aa178e46:365:31
at Map.forEach (<anonymous>)
at cmdk.js?v=aa178e46:365:15
at commitHookEffectListMount (chunk-B27YY5WJ.js?v=2667d1d7:16936:34)
at commitLayoutEffectOnFiber (chunk-B27YY5WJ.js?v=2667d1d7:17024:23)
at commitLayoutMountEffects_complete (chunk-B27YY5WJ.js?v=2667d1d7:18008:17)
But when you manually change the version of cmdk to 0.2.1, the problem goes away.
Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at Function.from (<anonymous>)
at A (cmdk.js?v=152e52e8:171:18)
at U2 (cmdk.js?v=152e52e8:137:13)
at cmdk.js?v=152e52e8:97:34
at cmdk.js?v=152e52e8:365:31
at Map.forEach (<anonymous>)
at cmdk.js?v=152e52e8:365:15
at commitHookEffectListMount (chunk-B27YY5WJ.js?v=593761cf:16936:34)
at commitLayoutEffectOnFiber (chunk-B27YY5WJ.js?v=593761cf:17024:23)
at commitLayoutMountEffects_complete (chunk-B27YY5WJ.js?v=593761cf:18008:17)
System Info
Mac, Chrome/Firefox
Before submitting
[X] I've made research efforts and searched the documentation
Describe the bug
I had a weird error that is caused from cmdk library. Currently, the documentation does not warn about cmdk@1.0.0 version just telling to install the latest version, and I get this error.
I tried to change the version to direct previous version, and it work as expected.
Affected component/components
Combobox, Command
How to reproduce
✔ Would you like to use TypeScript (recommended)? … yes ✔ Which style would you like to use? › Default ✔ Which color would you like to use as base color? › Zinc ✔ Where is your global CSS file? … src/globals.css ✔ Would you like to use CSS variables for colors? … yes ✔ Are you using a custom tailwind prefix eg. tw-? (Leave blank if not) … ✔ Where is your tailwind.config.js located? … tailwind.config.js ✔ Configure the import alias for components: … @/components ✔ Configure the import alias for utils: … @/lib/utils ✔ Are you using React Server Components? … no ✔ Write configuration to components.json. Proceed? … yes
install combobox
so far, installed dependency is this:
cmdk-bug-test.zip
make Combobox following here
import it. main.tsx
ReactDOM.createRoot(document.getElementById('root')!).render( );
But when you manually change the version of cmdk to 0.2.1, the problem goes away.
Codesandbox/StackBlitz link
https://github.com/wootra/cmdk-bug-test
Logs
System Info
Before submitting