Open haegemonia76 opened 5 years ago
Hi @haegemonia76 , I'm sorry about that, I'll try to reproduce it and I'll be back with a reply soon.
@haegemonia76 I'm not able to reproduce your error. Have you changed your tsconfig.json
recently? Because it seems that ts compiler is doing a strict null check on the library and usually it shouldn't do that on third party libs. Can you post your tsconfig.json
here please?
here's my tsconfig and tsconfig.app, but i didn't see anything wrong, there's no problem for the other package that i use. :/
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strict": true,
"importHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"plugins": [
{
"name": "typescript-tslint-plugin",
"alwaysShowRuleFailuresAsWarnings": false,
"ignoreDefinitionFiles": true,
"suppressWhileTypeErrorsPresent": false
}
]
}
}
tsconfig.app.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": ["node"]
},
"exclude": ["test.ts", "**/*.spec.ts"]
}
The strict: true
is the one that is generating the error. Try to exclude the node_modules
folder from your tsconfig:
"exclude": [
....
"node_modules"
]
If that doesn't work try to set "strict": false
. I'll improve the lib to be compatible with strict checks anyway.
Setting "strict"
to false solved the problem thanks, but yeah, i prefer to let the strict mode to true.
I hope that there will be a release soon 😄
Hi, same issue here with aot, I have joyride v2.2.10 but there is no tag for this release
i can not remove the strict mode from tsconfig, as this is the best practise that we are following. Is there any other way this problem can be solved?
@ViewChild(JoyrideDirective) joyride: JoyrideDirective;
sub: Subscription;
ngAfterViewInit() { this.sub = this.joyride.done!.subscribe(_ => {}); }
ngOnDestroy() { this.sub.unsubscribe(); }
Describe the bug when i try to compile my angular 7, this error occured after the
v2.2.4
excluded :ERROR in node_modules\ngx-joyride\joyride.d.ts.JoyrideStepComponent.html(1,47): : Object is possibly 'undefined'.
To Reproduce
ng build "--aot"
Expected behavior no error when compiling my project.
Details (please complete the following information): List of the dependencies :