Skip to content

after export = DiffEngine i see TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. #22

@gustawdaniel

Description

@gustawdaniel

https://stackoverflow.com/questions/62273153/this-module-is-declared-with-using-export-and-can-only-be-used-with-a-defau

i have this problem only in code editor, I can lint, build and test without problems, but files with test have red flag in webstorm

Zrzut ekranu z 2023-03-28 08-46-39

I know that export = is docummented here https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require but it is not supported properly by IDE probably, on the other hand this

// CommonJS export
module.exports = DiffEngine
module.exports.default = DiffEngine

// ES module export
export default DiffEngine

works both for IDE and support all methods of imports

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