Skip to content

How to manage dependencies with conflicting type declarations? #24229

@micahblu

Description

@micahblu

I have already posted this issue in Stackoverflow but no one has any idea apparently on how to address this. I would consider this a concern of the Typescript project since they should have some idea or opinion on how to prevent such issues:

I have the error: Subsequent variable declarations must have the same type

This is occurring because two of my dependencies, both of which I need; declare the same type.

Jest :/node_modules/@types/jest/index.d.ts => declare var test: jest.

testcafe node_modules/testcafe//ts-defs/index.d.ts => declare var test: TestFn;

My project is a react/redux project using webpack, babel and obviously Typescript.

The error occurs when I am running my dev server via npm start which uses webpack-dev-server. It also creates a problem when I run jest since it uses testcafe's version of the declared Test type.

How can this be resolved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions