-
Notifications
You must be signed in to change notification settings - Fork 8
Description
With the latest update and support for React v19, this library breaks with the following error: TypeError: t.list is not a function
This happens whenever tests are run with happy-dom environment.
In fact, I tried running your own tests from the Anchorme.test.tsx file and they failed with the same error. The error is thrown in the <Anchorme/> component.
I have verified that this error does not occur with the previous version 4.0.1 of react-anchorme. This issue is not because of incompatibility with React as downgrading it does not solve it.
When I change the test environment to jsdom, this error goes away but due to preferences I cannot switch to jsdom and it is a bummer because the previous version worked fine with happy-dom.
I suspect this has something to do with the way react-anchorme is being bundled because I have also tried writing a test for anchorme while it was still a transitive dependency through react-anchorme and my test environment was able to access the .list() without errors hinting that the issue is not within anchorme but rather the way it is bundled within react-anchorme.