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

TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. #6

Open
itsyoboieltr opened this issue Jan 14, 2024 · 6 comments

Comments

@itsyoboieltr
Copy link

I am trying to use the library in SolidStart. I keep on getting this error:

(home).tsx:13 TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at getComputedStyle (floating-ui.utils.dom.mjs?v=ec75b833:72:29)
    at isOverflowElement (floating-ui.utils.dom.mjs?v=ec75b833:40:7)
    at getOverflowAncestors (floating-ui.utils.dom.mjs?v=ec75b833:123:55)
    at Object.autoUpdate [as whileElementsMounted] (floating-ui.dom.mjs?v=ec75b833:526:75)
    at Object.fn (index.mjs?v=ec75b833:71:33)
    at runComputation (chunk-RPEO2QY4.js?v=ec75b833:707:22)
    at updateComputation (chunk-RPEO2QY4.js?v=ec75b833:689:3)
    at runTop (chunk-RPEO2QY4.js?v=ec75b833:798:7)
    at runUserEffects (chunk-RPEO2QY4.js?v=ec75b833:907:36)
    at chunk-RPEO2QY4.js?v=ec75b833:865:34
@gabrielmfern
Copy link

I also had this. Seems like, after a lot of debugging, this is being caused because the ref is set before the element is actually inserted into the DOM which causes floating-ui to not find its parent's computed styles.

@itsyoboieltr
Copy link
Author

I also had this. Seems like, after a lot of debugging, this is being caused because the ref is set before the element is actually inserted into the DOM which causes floating-ui to not find its parent's computed styles.

Could you fix it? @gabrielmfern

@gabrielmfern
Copy link

@itsyoboieltr Here's a link for the support thread on Discord that others from the community helped me in fixing it

https://discord.com/channels/722131463138705510/1215409288030330972

@beoxgame
Copy link

@itsyoboieltr Here's a link for the support thread on Discord that others from the community helped me in fixing it

https://discord.com/channels/722131463138705510/1215409288030330972

I can't open this link, can you show me the code to let me known how to fix it?

@gabrielmfern
Copy link

@beoxgame it's a bit of a long thread, the error might have a lot of causes, but in my situation it was my code rendering twice due to a bundler of mine. You need Discord installed for the link to work, it was inside of Solid's Discord server.

@beoxgame
Copy link

@beoxgame it's a bit of a long thread, the error might have a lot of causes, but in my situation it was my code rendering twice due to a bundler of mine. You need Discord installed for the link to work, it was inside of Solid's Discord server.

thx, after joined solid's channel, the link is working fine.

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

No branches or pull requests

3 participants