Closed
Description
Environment
What version are you running? Etc.
"@headlessui/react": "^2.1.5",
"@heroicons/react": "^2.1.5",
"@sentry/nextjs": "^8.28.0",
"next": "14.2.8",
"react": "^18",
"react-dom": "^18"
I've created a point-in-time backup of my current working project here: https://github.com/brandinchiu/sentry-build-error
Disabling reactComponentAnnotation
will allow the build to complete successfully.
Steps to Reproduce
- followed this tutorial to get Sentry installed on a blank Nextjs project: https://docs.sentry.io/platforms/javascript/guides/nextjs/
- create a page in Nextjs that makes use of a component from headlessui/react
- attempt to build the application with
reactComponentAnnotation
enabled.
Expected Result
Build should complete.
Actual Result
Build fails. Error is throw indicating that Nextjs prerendering failed when trying to inject Sentry annotations into components:
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Passing props on "Fragment"!
The current component <Menu /> is rendering a "Fragment".
However we need to passthrough the following props:
- data-sentry-element
- data-sentry-component
- data-sentry-source-file
- data-headlessui-state
You can apply a few solutions:
- Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".
- Render a single element as the child so that we can forward the props onto that element.
...
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Waiting for: Product Owner