ionic-team / ionic-app-scripts

App Build Scripts for Ionic Projects
http://ionicframework.com/
MIT License
608 stars 302 forks source link

TypeError: Cannot read property 'getStart' of undefined #1512

Closed alphagamer7 closed 5 years ago

alphagamer7 commented 5 years ago

Short description of the problem:

screen shot 2019-02-02 at 1 27 56 am

When ionic build is run I get this error, probably since the getStart methods source is missing. Have installed the relevant typescript packages. Have already tried removing node_modules and reinstalling, but ended up with same issue.

TypeError: Cannot read property 'getStart' of undefined
TypeError: Cannot read property 'getStart' of undefined

What behavior are you expecting?

I want to successfully build the ionic project using ionic-app-script.

Which @ionic/app-scripts version are you using? 3.2.1

package.json file is as follows

{
  "name": "health-care",
  "version": "0.0.1",
  "author": "Athif",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve",
    "lint": "ionic-app-scripts lint",
    "test": "ng test",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/router": "^7.2.2",
    "@comparenetworks/imsmart-web": "5.0.20",
    "@ionic/angular": "^4.0.0",
    "@ngrx/core": "^1.2.0",
    "@ngrx/effects": "^7.2.0",
    "@ngrx/router-store": "^7.2.0",
    "@ngrx/store": "^7.2.0",
    "@ngrx/store-devtools": "^7.2.0",
    "codelyzer": "~4.5.0",
    "core-js": "^2.5.4",
    "ionic-configuration-service": "^6.0.0",
    "lodash": "^4.17.11",
    "rxjs": "^6.4.0",
    "rxjs-compat": "^6.4.0",
    "tslint": "~5.12.1",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular/cli": "^7.3.0",
    "@ionic/app-scripts": "^3.2.1",
    "@types/lodash": "^4.14.117",
    "typescript": "3.2.1"
  },
  "description": "HealthCare"
}

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc) Possibly related - github.com/brackets-userland/brackets-typescript/issues/6 github.com/palantir/tslint-react/issues/87 https://stackoverflow.com/questions/54363489/having-an-error-at-build-time-showing-cannot-read-property-getstart-of-undefi

liamdebeasi commented 5 years ago

Hi there, thanks for filing an issue with us. Would you be able to provide the output from running ionic info?

Thanks for using Ionic!

alphagamer7 commented 5 years ago

@liamdebeasi thanks for the reply ionic info is as follows: Ionic:

ionic (Ionic CLI) : 4.10.1 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.0.0 @angular-devkit/build-angular : 0.12.4 @angular-devkit/schematics : 7.2.4 @angular/cli : 7.3.0 @ionic/angular-toolkit : 1.2.3

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : not available Cordova Plugins : not available

System:

NodeJS : v10.13.0 (/usr/local/bin/node) npm : 6.4.1 OS : macOS Mojave Xcode : Xcode 10.1 Build version 10B61

Full stack trace error for ionic build (using ionic-app-scripts build as per package.json) -

 TypeError: Cannot read property 'getStart' of undefined
TypeError: Cannot read property 'getStart' of undefined
    at Object.replaceNode (/node_modules/@ionic/app-scripts/dist/util/typescript-utils.js:49:27)
    at Object.getUpdatedAppNgModuleContentWithDeepLinkConfig (node_modules/@ionic/app-scripts/dist/deep-linking/util.js:267:31)
    at node_modules/@ionic/app-scripts/dist/transpile.js:139:39
    at new Promise (<anonymous>)
    at transpileWorker (node_modules/@ionic/app-scripts/dist/transpile.js:107:12)
    at Object.transpile (node_modules/@ionic/app-scripts/dist/transpile.js:64:12)
    at node_modules/@ionic/app-scripts/dist/build.js:109:82
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! health-care@0.0.1 ionic:build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the health-care@0.0.1 ionic:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
liamdebeasi commented 5 years ago

Hi @alphagamer7,

Ionic 4 doesn't use ionic-app-scripts, so you can safely uninstall that. Additionally, I'd recommend updating the scripts section of your package.json with the ones found in the conference app: https://github.com/ionic-team/ionic-conference-app/blob/master/package.json.

I'm going to close this, but if you have more questions about migrating to Ionic 4, please consult the Migration Guide, create a post on the forums, or ask a question on the Ionic Worldwide Slack.

Thanks for using Ionic!