Ionic App,Typescript Error无法找到名称'RequestMode'

时间:2017-08-14 07:48:26

标签: angular ionic2 servicestack ionic3

我的离子应用中存在问题,经过离子和放大器的一些更新后angular servicestack给我错误如下

  

Typescript Error找不到名称'RequestMode'。   node_modules / servicestack的客户端/ SRC / index.d.ts

oneWayBaseUrl: string;
mode: RequestMode;
credentials: RequestCredentials;
  

Typescript Error无法找到名称“RequestCredentials”。   node_modules / servicestack的客户端/ SRC / index.d.ts

mode: RequestMode;
credentials: RequestCredentials;
headers: Headers;

我的离子,角度和电脑信息

Typescript : 2.4.2
Ionic Framework: 3.1.1
Ionic App Scripts: 1.3.4
Angular Core: 4.0.2
Angular Compiler CLI: 4.0.2
Node: 6.10.0
OS Platform: macOS Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

tsconfig.json文件

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "module": "commonjs",
    "lib": ["dom","es2015"],
    "moduleResolution": "node",
    "sourceMap": true
  },
  "include": [
    "src/**/*.ts",
    "typings/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

1 个答案:

答案 0 :(得分:1)

这是使用最新tsconfig.json that servicestack-client was built withv2.4.2 of typescript,它引用了TypeScript内置lib.dom.d.ts中的W3C提取类型,因此,如果你引用了lib dom您可以访问这些丢失的类型。

不确定您的项目存在什么问题,但我会查看任何可能导致类型定义冲突的内容,例如可能导致冲突的任何typings/*