Swiip / generator-gulp-angular

Yeoman generator for AngularJS with GulpJS [UNMAINTAINED next iteration is FountainJS]
http://fountainjs.io
3.72k stars 665 forks source link

Cannot read property 'srcExtension' of undefined #891

Open tlvince opened 8 years ago

tlvince commented 8 years ago

When upgrading from a project scaffolded by an earlier version of this generator, Cannot read property 'srcExtension' of undefined is thrown:

❯ npm i -g generator-gulp-angular
❯ yo gulp-angular                          

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |         Welcome!         |
   `---------´   |                          |
    ( _´U`_ )    |     You're using the     |
    /___A___\    |  fantastic generator for |
     |  ~  |     |      scaffolding an      |
   __'.___.'__   | application with Angular |
 ´   `  |° ´ Y ` |         and Gulp!        |
                 '--------------------------'

? May generator-gulp-angular anonymously report usage statistics to improve the tool over time? No
? Existing .yo-rc configuration found, would you like to use it? Yes
events.js:85
      throw er; // Unhandled 'error' event
            ^
TypeError: Cannot read property 'srcExtension' of undefined
    at null.<anonymous> (/usr/local/lib/node_modules/generator-gulp-angular/app/src/files.js:23:108)
    at Array.map (native)
    at prepareFiles (/usr/local/lib/node_modules/generator-gulp-angular/app/src/files.js:47:33)
    at /usr/local/lib/node_modules/generator-gulp-angular/node_modules/yeoman-generator/lib/base.js:429:16
    at processImmediate [as _immediateCallback] (timers.js:367:17)

.yo-rc.json:

{
  "generator-gulp-angular": {
    "props": {
      "angularVersion": "~1.3.4",
      "angularModules": [],
      "jQuery": {
        "name": null,
        "version": null
      },
      "resource": {
        "name": null,
        "version": null,
        "module": null
      },
      "router": {
        "name": "angular-ui-router",
        "version": "~0.2.13",
        "module": "ui.router"
      },
      "ui": {
        "name": "bootstrap-sass-official",
        "version": "~3.3.1",
        "key": "bootstrap",
        "module": null
      },
      "bootstrapComponents": {
        "name": "angular-bootstrap",
        "version": "0.12.x",
        "key": "ui-bootstrap",
        "module": "ui.bootstrap"
      },
      "cssPreprocessor": {
        "key": "node-sass",
        "extension": "scss",
        "npm": {
          "gulp-sass": "~1.1.0"
        }
      }
    }
  }
}
Swiip commented 8 years ago

That should be a really old .yo-rc.json file as it don't mention a jsPreprocessor choice. I'm afraid we don't support backward compatibility that old.

Try refusing using the old .yo-rc.json and choosing equivalent options.