Closed andyjessop closed 10 months ago
Thank you for reporting @andyjessop! :slightly_smiling_face:
It seems like your Typescript configuration is type checking the internals of Happy DOM which will cause problems like this.
How does your tsconfig look?
I believe this is a JavaScript TypeError
, not a TS one. Our tsconfig us setup to exclude node_modules.
I'm not sure how to reproduce this. isConnected
is a normal property in Javascript. This seem to happen in the constructor of the Node
class when it is initializing the properties with their default values.
Perhaps Axe or some other library is overriding the prototype of the Node
class?
I found this: https://github.com/dequelabs/axe-core/blob/b753f95090d6d6028f46479ce2b375681ff2d17b/lib/core/imports/polyfills.js#L314
isConnected
is not part of the prototype of the Node
class, so it gets polyfilled by Axe. The property is initialized by setting this.isConnected
to a value in the constructor instead.
This might be hard to fix in Happy DOM, but should probably be fixed.
@andyjessop the issue has been fixed now :slightly_smiling_face:
You can read more about the release here: https://github.com/capricorn86/happy-dom/releases/tag/v13.1.0
Amazing, thank you!
Expected behaviour
Test:
Component:
I expect this should either pass or fail with a valid error.
Actual Behavior
I get this error:
Additional context
Bun 1.0.18 Happy DOM ^12.10.3