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

update to version 3.4 throw ex :[Right-hand side of 'instanceof' is not an object] #184

Closed
liva0126 opened this issue Aug 23, 2024 · 19 comments

Comments

@liva0126
Copy link

No description provided.

@liva0126
Copy link
Author

This issue was fixed when I retreated to version 3.3.

@IDisposable
Copy link
Member

Can you give me a repro on JSFiddle? I can't really debug from here.

@pschmiedelenbw
Copy link

Same error here, unfortunately I also cannot give you a repro. The call is something like

domtoimage.toPng(someElement, { bgColor: '#fff', height, width }).then(dataUrl => ...)

It seems the problem is in isShadowRoot() which when called with a document element calls getWindow() which tries to access the ownerDocument, however that is not set for document elements.

IDisposable added a commit that referenced this issue Aug 26, 2024
Attempt to fix issue #184
@IDisposable
Copy link
Member

IDisposable commented Aug 26, 2024

Pushing v3.4.2 to see if that fixes it... reverting part of a PR I merged.

@IDisposable
Copy link
Member

Please verify or deny if v3.4.2 fixes this @pschmiedelenbw and @liva0126

@pschmiedelenbw
Copy link

That seems to fix the problem, thanks!

@cWenyu
Copy link

cWenyu commented Aug 27, 2024

Hi @IDisposable , it seems breaks the slotted element, can you please double check release 3.4.2 with #178

@IDisposable
Copy link
Member

Fixed in v3.4.3

@ktdd
Copy link

ktdd commented Sep 2, 2024

v3.4.3 is broken here with this error, 3.4.2 works. No ShadowDom in use, just a regular element.

@cWenyu
Copy link

cWenyu commented Sep 3, 2024

I have no issues to use 3.4.3 with regular elements (no shadow dom), see the example: https://jsfiddle.net/CWenyu/rh4Ljqa5/5/

@cannot-hero
Copy link

I use 3.4.3, il still has this probem, so I retreated to version 3.3

@codesculpture
Copy link

codesculpture commented Sep 11, 2024

@IDisposable
The library is broken, in this commit (specifically this line)

Object.hasOwn(value, 'getRootNode') which is not producing same output as 'getRootNode' in value

I am not sure the reason behind this but it is producing different output.
Kindly look at this , since we were depending on "disableEmbedFont" which is introduced in the same commit

Edit: I am not blocked by this issue, since 3.4.2 consists of disableEmbefFonts with revert of this Object.hasOwnProperty change. So am using 3.4.2 but still this needs to be fixed.

@codesculpture
Copy link

I use 3.4.3, il still has this probem, so I retreated to version 3.3

3.4.2 consist of revert of this issue, so its safe to use 3.4.2 in case you want disableEmbedFonts options.
@cannot-hero

@IDisposable
Copy link
Member

How about v3.4.4 just released @codesculpture @cannot-hero @ktdd

@cannot-hero
Copy link

@IDisposable i just tried v3.4.4, still have this problem
image

@IDisposable
Copy link
Member

I can't reproduce this anywhere, can you contribute a test to the .spec.js file?

@codesculpture
Copy link

Can we reopen this (this issue is not listed on my home page, where it seems only opened issues would pop up there, i need to manually come to the repo find this issue to comment)
@IDisposable

@codesculpture
Copy link

codesculpture commented Sep 12, 2024

Duplicated this issue (since this is closed) here

@codesculpture
Copy link

This been addressed here #189

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

7 participants