pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.56k stars 274 forks source link

NextJS Support #28

Closed joshcawthorne closed 2 years ago

joshcawthorne commented 2 years ago

Does this library officially support NextJS, or have any plans to? When trying to integrate it to a larger existing NextJS codebase, I received the following error:

Unhandled Runtime Error
TypeError: react__WEBPACK_IMPORTED_MODULE_0__.useId is not a function

Call Stack
eval
node_modules/cmdk/dist/index.mjs (1:719)

However, when trying to make a minimal reproduction, I failed to get it to load at all, with Next complaining of a missing webpack loader -- not sure what loader is required in this instance.

See codesandbox here: https://codesandbox.io/s/charming-darkness-gw9ezm

TL;DR - Library doesn't seem to work with NextJS right now.

pacocoursey commented 2 years ago

Sounds like you're not using React 18, which is required and mentioned explicitly.