Skip to content

Types breakage in v6.4.0 #574

Closed
Closed
@Rugvip

Description

@Rugvip

We're seeing an issue with the types in the latest release (v6.4.0). In particular the addition of the ByRoleMatcher type declaration breaks the export assignment later on, resulting in the following error:

TS2309: An export assignment cannot be used in a module with other exported elements.
  • @testing-library/jest-dom version: v6.4.0
  • node version: n/a
  • jest (or vitest) version: n/a
  • npm (or yarn) version: n/a

Relevant code or config:

tsconfig.json

What you did:

Example breakage in a CI run here: https://github.com/backstage/backstage/actions/runs/7708717042/job/21008397598?pr=22596

What happened:

node_modules/@testing-library/jest-dom/types/matchers.d.ts:713:1 - error TS2309: An export assignment cannot be used in a module with other exported elements.

713 export = matchers
    ~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@testing-library/jest-dom/types/matchers.d.ts:713

Reproduction:

Doesn't seem to reproduce in codesandbox, may be related to TypeScript version or config?

Problem description:

Breaks TypeScript type checks.

Suggested solution:

Might be enough to switch the re-export to export { matchers }?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions