Not relevant.
with tslint.json configuration:
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"jsRules": {},
"rules": {
"indent": [true, "spaces", 2],
"interface-name": false,
"arrow-parens": false,
"newline-before-return": true,
"no-consecutive-blank-lines": false,
"no-console": { "severity": "warning" },
"no-debugger": { "severity": "warning" },
"no-empty": { "severity": "warning", "options": "allow-empty-catch" },
"no-irregular-whitespace": true,
"no-shadowed-variable": false,
"no-unused-variable": { "severity": "warning" },
"no-string-literal": false,
"object-literal-sort-keys": false,
"object-literal-key-quotes": {
"severity": "warning",
"options": "as-needed"
},
"ordered-imports": false,
"prefer-switch": true,
"semicolon": false,
"space-within-parens": true,
"quotemark": [true, "single"],
"trailing-comma": false,
"variable-name": true
},
"rulesDirectory": []
}
I'm getting the following error in my VS Code console:
[Info - 12:41:51 AM] Linter is running.
[Info - 12:41:52 AM] TSLint library loaded from: /Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/tslint/lib/index.js
TypeError: Cannot read property 'kind' of undefined
at declareSymbolAndAddToSymbolTable (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:21243:30)
at bindPropertyOrMethodOrAccessor (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:22217:19)
at bindWorker (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:21770:28)
at bind (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:21619:13)
at bindSourceFile (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:20028:17)
at Object.bindSourceFile (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:19971:9)
at initializeTypeChecker (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:47292:20)
at Object.createTypeChecker (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:24912:9)
at getDiagnosticsProducingTypeChecker (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:74325:93)
at Object.getGlobalDiagnostics (/Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/node_modules/typescript/lib/typescript.js:74703:53)
Things were fine until I did a yarn upgrade just now. Honestly it's a bit tough to tell if it's coming from TSLint or TypeScript itself, but I figured I'd start here.
I've the same problem and my diagnostic is that it's from typescript (not tslint) as
I wound up removing TS from my Vue project. I feel this particular combo is just not ready for prime time.
For your information, I had this problem while trying to build an ionic project in prod. I installed yarn and used it instead of npm, this fixed my issue.
npm i -save yarn
yarn
ionic cordova build android --prod
Xample Solve the same problem. Thank you very much.
I wonder what makes this different though...
Hi there,
I think this is a dupe of https://github.com/palantir/tslint/issues/3711
Feel free to re-open if you disagree.
Thanks,
TSLint Team
Same Issue. Installing yarn and updating typescript to 2.8.1 do not solve.
The issue only pop with the "ionic cordova build android --prod"
but not without the "--prod" flag "ionic cordova build android".
TypeError: Cannot read property 'kind' of undefined
at declareSymbolAndAddToSymbolTable (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:22164:31)
at bindPropertyOrMethodOrAccessor (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:23169:19)
at bindWorker (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:22690:28)
at bind (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:22538:13)
at bindSourceFile (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:20944:17)
at Object.bindSourceFile (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:20887:9)
at initializeTypeChecker (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:49034:20)
at Object.createTypeChecker (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:25936:9)
at getDiagnosticsProducingTypeChecker (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:76224:93)
at emitWorker (/Users/me/Desktop/proj/client/node_modules/typescript/lib/typescript.js:76270:32)
Same Issue
Running typescript 2.8.1.
The issue only pops up with the "ionic cordova build ios --prod"
but works without the "--prod" flag "ionic cordova build ios".
ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.3.0 browser 5.0.1 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
ios-sim : 6.0.0
Node : v8.9.4
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145
Environment Variables:
ANDROID_HOME : ~/Library/Android/sdk
Misc:
backend : pro
Here is error output:
☁ XXXXXXXX [master] ⚡ ionic cordova build ios --release --prod
Running app-scripts build: --prod --platform ios --target cordova
[10:50:07] build prod started ...
[10:50:07] clean started ...
[10:50:07] clean finished in 4 ms
[10:50:07] copy started ...
[10:50:07] deeplinks started ...
[10:50:07] deeplinks finished in 62 ms
[10:50:07] ngc started ...
TypeError: Cannot read property 'kind' of undefined
at declareSymbolAndAddToSymbolTable (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:22164:31)
at bindPropertyOrMethodOrAccessor (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:23169:19)
at bindWorker (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:22690:28)
at bind (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:22538:13)
at bindSourceFile (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:20944:17)
at Object.bindSourceFile (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:20887:9)
at initializeTypeChecker (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:49034:20)
at Object.createTypeChecker (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:25936:9)
at Object.getTypeChecker (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:76230:79)
at moduleNameResolvesToAmbientModuleInNonModifiedFile (/Users/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/node_modules/typescript/lib/typescript.js:75986:88)
[10:50:25] copy finished in 17.89 s
We don't need to move to Production yet... so I will let this simmer and hope someone patches.
Thanks.
Hey @BinaryBlock,
Check if you have @angular/cli installed directly in your package.json.
There seems to be a conflict with the typescript version installed via @ionic/app-scripts and @angular/cli that results in an error in the ngc command during a production build.
If it is installed as a direct dependency:
npm un @angular/cliyarn: npm i yarn yarn add @angular/cli -D.@angular/[email protected].
Most helpful comment
For your information, I had this problem while trying to build an ionic project in prod. I installed yarn and used it instead of npm, this fixed my issue.