Jafar Sabah
Jafar Sabah

Reputation: 136

Ionic App, Typescript Error Cannot find name 'RequestMode'

I have problem in my ionic app, after some updates in ionic & angular servicestack give me errors like the below

Typescript Error Cannot find name 'RequestMode'. node_modules/servicestack-client/src/index.d.ts

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

Typescript Error Cannot find name 'RequestCredentials'. node_modules/servicestack-client/src/index.d.ts

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

my ionic, angular and pc info

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 file

{
  "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
  }
}

Upvotes: 3

Views: 722

Answers (1)

mythz
mythz

Reputation: 143339

This is the tsconfig.json that servicestack-client was built with using the latest v2.4.2 of typescript where it references the W3C fetch types in TypeScript's built-in lib.dom.d.ts, so if you're referencing lib dom you'll have access to these missing types.

Not sure what the issue is with your project but I'd look into anything that can cause type definition conflicts like any typings/* that may cause conflicts.

Upvotes: 1

Related Questions