Skip to content

TypeError: t.list is not a function #32

@Ninfa-Jeon

Description

@Ninfa-Jeon

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.

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions