I am using Ionic2 and am getting this error:
Runtime Error Cannot read property 'prototype' of undefined
Reading here and here, it suggests it could be related to the order in which a subclass and baseclass are declared. I am using a baseclass with a subclass. Where do you change the order in which they are declared, is it in the imports? In what file?
Funny thing is my code was working fine, and suddenly started to get this error, even without me changing the base or sub classes. I did make a change to another file, which I have now reverted, but still get the error.
More details:
Error:
main.js:24046Uncaught TypeError: Cannot read property 'prototype' of undefined at __extends (main.js:24046) at job.ts:26 at Object.<anonymous> (job.ts:24) at __webpack_require__ (bootstrap cdd11c2…:19) at Object.<anonymous> (main.js:46012) at __webpack_require__ (bootstrap cdd11c2…:19) at Object.<anonymous> (personModel.ts:21) at __webpack_require__ (bootstrap cdd11c2…:19) at Object.<anonymous> (locationModel.ts:11)
Code:
job.ts
import { Component, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { NavController, NavParams, InfiniteScroll, Content, Platform, Events, AlertController, LoadingController, ViewController, PopoverController } from 'ionic-angular';
import { JobModel } from '../model/jobModel';
import { PersonModel } from '../model/personModel';
import { SubCategoryModel } from '../model/subCategoryModel';
import { LocationModel } from '../model/locationModel';
import { RatingModel } from '../model/ratingModel';
import { ReviewPage } from '../review/review';
import { ChatsPage } from '../chats/chats';
import { CategoryPage } from '../category/category';
import { PersonPage } from '../person/person';
import { MyCameraPage } from '../mycamera/mycamera';
import { JobService } from '../service/jobService';
import { PersonService } from '../service/personService';
import { RatingService } from '../service/ratingService';
import { UtilityService } from '../utils/utilityService';
import { SearchJobsParent } from '../searchjobs/searchjobsParent';
import { MapRangeService } from '../service/mapRangeService';
@Component({
selector: 'job',
templateUrl: 'job.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class JobPage extends SearchJobsParent {
@ViewChild(Content) content: Content;
.....
searchJobsParent.ts
...
@Component({
})
export class SearchJobsParent {
...
ionic info
Your system information:
Cordova CLI: You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Not installed