Skip to content

Unclear on how to use allowJS with untyped modules installed with npm #7542

@raybooysen

Description

@raybooysen

TypeScript Version:

1.8.7

Code

import classnames from 'classnames';

If I write the following code with a tsconfig that has allowJs = true, I receive the error below.

ERROR in ./src/ts-loader-example/headerBar.tsx
(3,24): error TS2307: Cannot find module 'classnames'.

I expect this to work as per the documentation for 1.8. I have found the following stackoverflow question which shows that there is some other that are unsure on how to accomplish this.

As a developer moving from JS to TS, how do I consume untyped modules with the allowJs flag?

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions