Skip to content

Error in useKey when using in NextJS 13 #259

@kkga

Description

@kkga

Describe the bug

Getting an error in NextJS 13 (app directory), which looks very similar to this: vercel/next.js#44014.

Like in the linked issue, the document seems to be available to the component as the keyboard shortcuts are working, however I see this output in the terminal console:

error - node_modules/react-complex-tree/lib/cjs/hotkeys/useKey.js (6:0) @ useKey
error - ReferenceError: document is not defined

To Reproduce

I'm finding it hard to reproduce the issue on cloud platforms like codesandbox.

Desktop (please complete the following information):

  • OS: macOS Ventura 13.3.1
  • Browser: Firefox 112
  • NextJS: v13.3.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions