[Bug]: Server-side rendering broken on Menu and OverflowMenu #16251
Labels
role: dev 🤖
severity: 2
https://ibm.biz/carbon-severity
status: waiting for maintainer response 💬
type: bug 🐛
Package
@carbon/react
Browser
No response
Package version
v1.55.0
React version
18.02
Description
Reported on Slack
When using NextJS with
Menu
andOverflowMenu
with server-side rendering the following error shows up:Internal error: ReferenceError: document is not defined
This might be solved by using this helper:
carbon/packages/react/src/internal/useEvent.js
Lines 68 to 94 in 71c553c
Reproduction/example
https://stackblitz.com/edit/stackblitz-starters-vavqe5?file=app%2Fpage.tsx
Steps to reproduce
Open Stackblitz example and check the console log
Suggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: