This morning I was updating the ionic and after the upgrade appeared this error:
Typescript Error
Class ‘Tabs’ incorrectly implements interface ‘NavigationContainer’. Types of property ‘parent’ are incompatible. Type ‘NavControllerBase’ is not assignable to type ‘NavController’. Types of property ‘popTo’ are incompatible. Type ‘(indexOrViewCtrl: any, opts?: NavOptions, done?: () => void) => Promise<any>’ is not assignable to type ‘(page: string | Page | ViewController, params?: any, opts?: NavOptions, done?: Function) => Promi...’. Types of parameters ‘done’ and ‘opts’ are incompatible. Type ‘NavOptions’ is not assignable to type ‘() => void’. Type ‘NavOptions’ provides no match for the signature ‘(): void’.
150. */
151. export declare class Tabs extends Ion implements AfterViewInit, RootNode, ITabs, NavigationContainer {
152. viewCtrl: ViewController;
Typescript Error
Class ‘NavControllerBase’ incorrectly implements interface ‘NavController’. Types of property ‘popTo’ are incompatible. Type ‘(indexOrViewCtrl: any, opts?: NavOptions, done?: () => void) => Promise<any>’ is not assignable to type ‘(page: string | Page | ViewController, params?: any, opts?: NavOptions, done?: Function) => Promi...’. Types of parameters ‘done’ and ‘opts’ are incompatible. Type ‘NavOptions’ is not assignable to type ‘() => void’. Type ‘NavOptions’ provides no match for the signature ‘(): void’.
Good morning guys.
I do not know if this is the best solution of the problem, but since I’m in the rush and the client was on top of me, it was what helped me, if someone is going through the same problem as me, that’s how I did it.
Precisei alterar alguns arquivos no node_modules e foram esses dois:
Many thanks Jonatas, solved my problem.
I could see that you’re a great pro, and you solved the problem brilliantly.
Much success for you, and once again congratulations
Please don’t manually edit things under node_modules. That directory belongs to npm, and your changes are subject to being overwritten at any time.
Anybody having this problem should check their typescript dependency version. If it’s >2.3.4, try reverting to 2.3.4, which is the officially supported version. In general, when you update dependencies past what Ionic recommends, and run into any new problems, please revert to supported dependency versions and ensuring your problem persists before taking any further action.
@rapropos
Quiet brother I’ll do what you suggest, but at the moment the client was on top of me and had to upload the new version, so I was forced to look at the error I was giving in those files.
So for anybody wanting to hack anything up, I would only make the following change: take the params argument out of the popTo() declaration on line 466 of ionic-angular/navigation/nav-controller.d.ts. No modification should be needed to either nav-controller-base or tabs.
If your situation is like mine, TS 2.5.1 will also choke on rxjs 5.4.0 with a similar complaint about Subject. Upgrading rxjs to 5.4.3 resolved this.