Typescript Error '=' expected and more

solves my problem too after upgrading to 2.7.2

1 Like

Continuing the discussion from Typescript Error '=' expected and more:

HI below is my json file, i still get the typescript error also sharing my error’s below @rapropos plz do help me on this

{

“name”: “”,

“version”: “1.0.0”,

“author”: “Ionic Framework”,

“homepage”: “http://ionicframework.com/”,

“private”: true,

“scripts”: {

"clean": "ionic-app-scripts clean",

"build": "ionic-app-scripts build",

"lint": "ionic-app-scripts lint",

"ionic:build": "ionic-app-scripts build",

"ionic:serve": "ionic-app-scripts serve"

},

“dependencies”: {

"@angular/animations": "^4.3.6",

"@angular/cli": "^1.3.2",

"@angular/common": "4.1.3",

"@angular/compiler": "4.1.3",

"@angular/compiler-cli": "4.1.3",

"@angular/core": "4.1.3",

"@angular/forms": "4.1.3",

"@angular/http": "4.1.3",

"@angular/platform-browser": "4.1.3",

"@angular/platform-browser-dynamic": "4.1.3",

"@angular/router": "^4.4.1",

"@ionic-native/core": "3.12.1",

"@ionic-native/splash-screen": "3.12.1",

"@ionic-native/status-bar": "3.12.1",

"@ionic/app-scripts": "^3.2.4",

"@ionic/storage": "2.0.1",

"@types/moment": "^2.13.0",

"@types/moment-timezone": "^0.5.13",

"ajv": "^5.2.2",

"angular-calendar": "^0.21.2",

"angular-captcha": "^1.2.2",

"angular2-highcharts": "^0.5.5",

"angular2-signaturepad": "^2.9.0",

"cordova": "^6.5.0",

"ionic-angular": "^3.9.10",

"ionic-native": "^2.2.3",

"ionicons": "3.0.0",

"moment-timezone": "^0.5.26",

"ng2-charts": "^1.6.0",

"rxjs": "5.4.0",

"sw-toolbox": "3.6.0",

"typescript": "^2.7.2",

"zone.js": "0.8.12"

},

“devDependencies”: {

"@angular/cli": "^1.2.4"

},

“cordovaPlugins”: [

"cordova-plugin-whitelist",

"cordova-plugin-statusbar",

"cordova-plugin-console",

"cordova-plugin-device",

"ionic-plugin-keyboard",

"cordova-plugin-splashscreen",

"cordova-plugin-camera"

],

“cordovaPlatforms”: ,

“description”: “An Ionic project”

}

Typescript Error

‘;’ expected.

…g ortus/migrate/node_modules/moment-timezone/index.d.ts

names(): string;
zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;

Typescript Error

‘;’ expected.

…g ortus/migrate/node_modules/moment-timezone/index.d.ts

names(): string;
zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;

Typescript Error

‘;’ expected.

…g ortus/migrate/ManageMyHealthAU_migrate/node_modules/moment-timezone/index.d.ts

names(): string;
zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;

Typescript Error

‘;’ expected.

…g ortus/migrate/node_modules/moment-timezone/index.d.ts

zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;
zonesForCountry(country: string, with_offset?: boolean): MomentZoneOffset string;

Typescript Error

‘)’ expected.

…g ortus/migrate/node_modules/moment-timezone/index.d.ts

zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;
zonesForCountry(country: string, with_offset?: boolean): MomentZoneOffset string;

Typescript Error

Expression expected.

…g ortus/migrate/node_modules/moment-timezone/index.d.ts

zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;
zonesForCountry(country: string, with_offset?: boolean): MomentZoneOffset string;

Typescript Error

‘;’ expected.

…g ortus/migrate/node_modules/moment-timezone/index.d.ts

zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;
zonesForCountry(country: string, with_offset?: boolean): MomentZoneOffset string;

Typescript Error

Declaration or statement expected.

…g ortus/migrate/ManageMyHealthAU_migrate/node_modules/moment-timezone/index.d.ts

zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;
zonesForCountry(country: string, with_offset?: boolean): MomentZoneOffset string;

Typescript Error

‘;’ expected.

…g ortus/migrate/node_modules/moment-timezone/index.d.ts

zonesForCountry(country: string, with_offset: T): T extends true ? MomentZoneOffset : never;
zonesForCountry(country: string, with_offset?: T): T extends false ? string : never;
zonesForCountry(country: string, with_offset?: boolean): MomentZoneOffset string;

First thing I would do is ditch moment in favor of date-fns. There may be some version of moment-timezone that is compatible with your old typescript, but I’m not motivated to find it.

did you try adding "types": [] to the "compilerOptions" parameter of tsconfig.json as explained in this post?

1 Like

yes i tried, it doesn’t work

solved the issue by adding "types": [] to the "compilerOptions" in tsconfig.js :+1:

1 Like

this worked for me!
“types”: added to compilerOptions attr of tsconfig.json
but i kept my typescript to “typescript”: “~2.6.2”

thx a lot Gustavo

1 Like