Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

[0.0.39] Build fails with "TypeError: Cannot read property 'indexOf' of undefined" #305

Closed
@hayuki

Description

@hayuki

Short description of the problem:

Ever since updating to app-scripts 0.0.39 I get a TypeError: Cannot read property 'indexOf' of undefined when trying to build the project. Sometimes re-installing the latest app-scripts would "fix" the issue, but today nothing I do seems to resolve it, so I cannot build and run the app at all. I even deleted my node_modules folder and re-installed everything again - still the same issue.

What behavior are you expecting?

I'm expecting to be able to build and run the project with no problems.

Steps to reproduce:
Just a note - it seems to be random, sometimes it would work and sometimes not. Lately it's mostly the latter.

  1. Update to ionic-app-scripts 0.0.39
  2. Run ionic build or ionic run android
C:\DEV\Momentum App Ionic2\momentum-client-app-v2>ionic build

Running 'build:before' npm script before build

> momentumclientapp@1.0.0 build C:\DEV\Momentum App Ionic2\momentum-client-app-v2
> ionic-app-scripts build

[09:29:40]  ionic-app-scripts 0.0.39
[09:29:40]  build prod started ...
[09:29:40]  clean started ...
[09:29:40]  clean finished in 5 ms
[09:29:40]  copy started ...
Custom copy Ahoy
[09:29:40]  ngc started ...
C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\@ionic\app-scripts\dist\copy.js:120
                if (err.message.indexOf('ENOENT') > -1) {
                               ^

TypeError: Cannot read property 'indexOf' of undefined
    at C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\@ionic\app-scripts\dist\copy.js:120:32
    at doneOne (C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\@ionic\app-scripts\node_modules\fs-extra\lib\copy\ncp.js:237:23)
    at C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\@ionic\app-scripts\node_modules\fs-extra\lib\copy\ncp.js:122:11
    at C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\graceful-fs\polyfills.js:219:18
    at FSReqWrap.oncomplete (fs.js:123:15)

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! momentumclientapp@1.0.0 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the momentumclientapp@1.0.0 build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the momentumclientapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs momentumclientapp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls momentumclientapp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\DEV\Momentum App Ionic2\momentum-client-app-v2\npm-debug.log
Caught exception:
 undefined

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

Dev environment info:

Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.39
OS:
Node Version: v6.7.0

Any help would be really appreciated!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions