Skip to content

Error importing buildt ts files with allowJs #667

@Pajn

Description

@Pajn

We have a subproject that is built separately so that it produces .js and .d.ts files. With "allowJs": true I get the following error when importing a module from it:
TS2306: File /path/to/file.js is not a module.

This can be fixed by setting entryFileCannotBeJs: true but as that is going away I think this issue must be fixed first.

I have not looked deeper into it but the feeling I get is that ts-loader prefer the .js file over the .d.ts and thus errors. Plain TypeScript have not errors with this setup.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions