【发布时间】:2019-05-23 00:05:37
【问题描述】:
angular 7 的一个非常好的特性是对 typescript 3.1 的支持:
https://alligator.io/angular/angular-7/
我已将以下 3 行添加到 tsconfig.json 文件 - 在“compilerOptions”部分下:
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
一切看起来都不错——我可以毫无问题地遍历我的 json 文件。
但由于某种原因,我的 IDE 中出现“TS2307:找不到模块”错误:
我尝试将导入语法更改为此处的建议: Importing json file in TypeScript
但没有成功。
有什么想法吗?
编辑:我使用Webstorm 作为 IDE。
【问题讨论】:
-
你解决过这个问题吗?我正在处理同样的事情。
-
仍在等待答复。
标签: angular typescript compiler-errors