In my Ionic 3 application, I have the following code snippets:
@Injectable() // I also tried without @Injectable and encountered the same error
export class M_someClass {
constructor () {
}
method1 () { console.log("method1 used") }
}
@Injectable()
export class M_otherClass extends M_someClass {
callMethod1 () {
this.method1()
}
}
Upon launching my app, I encounter the error:
TypeError: Object.setPrototypeOf: expected an object or null, got undefined
Researching about this issue led me to a related question on Stack Overflow. From what I gathered in this GitHub issue page, it appears that the bug has been resolved in either typescript version 2.4.0 or 2.4.1.
However, upon checking my package.json file, I noticed that under "devDependencies", I am using "typescript": "~2.4.2"
.
I'm confused as to why the error persists despite using version 2.4.2.
Could it be possible that the bug was not completely fixed in TypeScript 2.4.2? If so, is there any workaround available to resolve this issue?
Alternatively, could the error be originating from another source within my code?