highlight.js: typescript build problem: node_modules/highlight.js/types/index.d.ts is not a module
ts file content:
// index.ts
import * as hljs from 'highlight.js';
after I run command
tsc index.ts
I got error
index.ts:1:23 - error TS2306: File '/Users/limbo/tmp/ssss/node_modules/highlight.js/types/index.d.ts' is not a module.
1 import * as hljs from 'highlight.js';
~~~~~~~~~~~~~~
Found 1 error.
The version I use is 10.1.0.
Try to use 10.0.2 and it build successfully.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 42 (26 by maintainers)
Commits related to this issue
- fix "is not a module" #2603 — committed to rodrigojcmello/highlight.js by rodrigojcmello 4 years ago
Same problems here. Suggest to refer to
exportfrom index.d.ts in @types/highlight.js:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/highlight.js/index.d.ts