#Sentry webpack reactComponentAnnotation ignoreComponent with HeadlessUI library

3 messages · Page 1 of 1 (latest)

simple steppe
#

Today we enabled the reactComponentAnnotation in our nextjs application, to find out that we got a bunch of errors from our Headless UI components.

After spending some time I found this PR: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/611
Stating that either not using fragments or skipping the annotation. However, I'm missing an example on how to disable for example:

"Headless.ListboxOption"

I used this array: ignoredComponents: ["Headless.ListboxOption", "Headless.CloseButton", "Radio", "ComboboxOption"],

As the code is: <Headless.ListboxOption as={Fragment} {...props}>

But I still get the fragment error/problem. Any clue how to ignore this component properly?

GitHub

Environment What version are you running? Etc. "@headlessui/react": "^2.1.5", "@heroicons/react": "^2.1.5", "@sentry/nextjs": "^8.28.0", ...

simple steppe
#

Okay, I found out that I did not exclude all Framework defaults of HeadlessUI, for example ListBox by default also uses a fragment to render. Adding all the elements with trail and error solved my issue