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: "Failed to execute 'getComputedStyle' on 'Window'" #300

Open
jonschlinkert opened this issue Feb 14, 2024 · 3 comments
Open

Error: "Failed to execute 'getComputedStyle' on 'Window'" #300

jonschlinkert opened this issue Feb 14, 2024 · 3 comments

Comments

@jonschlinkert
Copy link

It seems like the error happens randomly, but I'm sure it's related to something I haven't been able to figure out yet.

Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at createsStackingContext (findStackingContext.js:11:16)
    at findStackingContext (findStackingContext.js:33:8)
    at compare2 (index.js:25:6)
    at react-resizable-panels.browser.esm.js:423:7
    at Set.forEach (<anonymous>)
    at recalculateIntersectingHandles (react-resizable-panels.browser.esm.js:398:28)
    at HTMLBodyElement.handlePointerMove (react-resizable-panels.browser.esm.js:352:5)

I'm using React 18, and I'm also not rendering the component on the server.

@bvaughn
Copy link
Owner

bvaughn commented Feb 14, 2024

Sorry to hear that you're seeing this. This isn't going to be enough to go on for me to help though. If you're able to narrow down a repro, let me know.

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

FWIW I think this generally indicates that you're passing undefined to getComputedStyle – which I think would mean that the register drag handle element is missing, but I'm not sure how that would be possible given the code.

@jonschlinkert
Copy link
Author

FWIW I think this generally indicates that you're passing undefined to getComputedStyle – which I think would mean that the register drag handle element is missing, but I'm not sure how that would be possible given the code.

I'm not using getComputedStyle. I am using a hook though, to check if window exists to prevent SSR in an attempt to fix this issue. But that doesn't work. I'm open to suggestions.

@bvaughn
Copy link
Owner

bvaughn commented Feb 20, 2024

Sorry. I didn't mean "you" literally. I just meant, generally speaking, that error suggests that a value of undefined is being passed to getComputedStyle– which this library uses. I don't know how that would be possible though, looking at the code. I'll need a repro.

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

2 participants