Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Popovers – Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'. #2115

Closed
wottpal opened this issue Dec 21, 2022 · 6 comments
Assignees

Comments

@wottpal
Copy link

wottpal commented Dec 21, 2022

Hey there, I'm using latest tailwindcss & headlessui. I've just implemented the first responsive header example of TailwindUI (https://tailwindui.com/components/marketing/elements/headers). It also works just fine, but whenever I open the responsive mobile menu popover and then enlarge the screen (so that it gets hidden), it throws the following error:

TypeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'.

Screenshot 2022-12-21 at 08 09 04

@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

I can't seem to reproduce this. Can you create a minimal reproduction repo and attach it to the issue so that we can take a look?

@paustint
Copy link

I have been hitting this issue once in a while as well - I had a bout 17 rollbar uncaught exceptions in the past few days from users and I am having a hard time reproducing it.

I notice it comes up when I am working with playwright and writing e2e tests and make code changes but have not hit it myself otherwise, I just now noticed that it is impacting production users.

I will keep trying to reproduce it and report back if I find something.
I am on version
"@headlessui/react": "^1.7.4",

@paustint
Copy link

paustint commented Jan 19, 2023

I am able to reproduce.
I found a random stackblitz in this repo where I opened it and immediately experiences the issue: https://codesandbox.io/s/busy-rgb-r7boos?file=/src/App.tsx

open popover, click on the contents, then click off. (sometimes leaving the browser tab and coming back, then clicking may be a required step)

Here is a video showing the reproduction: https://jam.dev/c/fb7d982b-4f93-4c36-8cbe-cd5f01331886

The error stacktrace in my code base led to this minified code from headless:
image

@paustint
Copy link

Looks like I should have just tried upgrading, after looking through release notes I found a PR that looked promising and sure enough it appears to have fixed the problem.

#2019

@RobinMalfait
Copy link
Member

Thanks for providing a reproduction @paustint, and I'm happy that bumping to the latest version fixes the issue.

Going to close this issue for now since I think it is fixed with the linked PR. If you @wottpal, (or anyone else) still runs into this issue please make sure to:

  • Bump to the latest version
  • Open a new issue with a minimal reproduction repo attached so that we can take a look

@paustint
Copy link

@RobinMalfait - Looks like I am still hitting this issue in some cases, I will try to get a repro example if I can and open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants