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

Specifying document breaks the options #195

Closed
Kadeluxe opened this issue Mar 28, 2023 · 2 comments
Closed

Specifying document breaks the options #195

Kadeluxe opened this issue Mar 28, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Kadeluxe
Copy link

TypeError: Cannot set property ancestorOrigins of [object Location] which has only a getter

You shouldn't do deepAssign on settings object like that. Your deepAssign function tries to assign defaults to the window.document (???) and that completely crashes the library because browsers will not allow that.
I don't know why it throws such error only for my setup and not for other users and I have no time for proper investigations but I think it was worth reporting.

@Kadeluxe Kadeluxe added the unconfirmed Problem is not confirmed yet label Mar 28, 2023
@Kadeluxe
Copy link
Author

Actually the reason why is that your test site and probably other users don't set document option in settings, skipping that deepAssign for that property.

@simonwep
Copy link
Owner

simonwep commented Mar 29, 2023

I see, makes sense... Must have missed that when adding support for defining document :) I'll fix it this weekend or so... I'll probably remove deepAssign altogether and just use spread for each option, it's been a while.

@simonwep simonwep added bug Something isn't working and removed unconfirmed Problem is not confirmed yet labels Mar 29, 2023
@simonwep simonwep changed the title TypeError: Cannot set property ancestorOrigins of [object Location] which has only a getter Specifying document breaks the options Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants