问题描述
每当我尝试运行ng serve
时,都会出现以下错误。我已经尝试在allowSyntheticDefaultImports
中将esModuleInterop
和true
设置为tsconfig.json
。
我的打字稿和当下版本是
"typescript": "^3.9.7"
"moment": "^2.27.0"
我的tsconfig如下:
{
"compilerOptions": {
"allowJs": true,"allowSyntheticDefaultImports": true,"baseUrl": ".","esModuleInterop": true,"experimentalDecorators": true,"rootDir": "."
},"files": [],"references": [
{
"path": "./tsconfig.app.json"
},{
"path": "./tsconfig.spec.json"
}
]
}
当前导入的时刻为import moment from "moment";
。如果以其他方式导入它,则会得到Type 'typeof moment' has no call signatures.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)