generator-gulp-angular icon indicating copy to clipboard operation
generator-gulp-angular copied to clipboard

New Project Doesn't Load Index

Open devonzara opened this issue 10 years ago • 4 comments

When creating a new project and running gulp serve or gulp serve:dist I get:

Uncaught Error: [$injector:modulerr] Failed to instantiate module ng due to: Error: [$injector:strictdi] function($provide) is not using explicit annotation and cannot be invoked in strict mode http://errors.angularjs.org/1.4.7/$injector/strictdi?p0=function(%24provide) at http://localhost:3000/bower_components/angular/angular.js:68:12 at Function.annotate as $$annotate at Object.invoke (http://localhost:3000/bower_components/angular/angular.js:4456:36) at runInvokeQueue (http://localhost:3000/bower_components/angular/angular.js:4384:35) at http://localhost:3000/bower_components/angular/angular.js:4393:11 at forEach (http://localhost:3000/bower_components/angular/angular.js:336:20) at loadModules (http://localhost:3000/bower_components/angular/angular.js:4374:5) at createInjector (http://localhost:3000/bower_components/angular/angular.js:4299:11) at doBootstrap (http://localhost:3000/bower_components/angular/angular.js:1657:20) at bootstrap (http://localhost:3000/bower_components/angular/angular.js:1678:12) http://errors.angularjs.org/1.4.7/$injector/modulerr?p0=ng&p1=Error%3A%20%5…F%2Flocalhost%3A3000%2Fbower_components%2Fangular%2Fangular.js%3A1678%3A12)

Here is the .yo-rc.json:

{
  "generator-gulp-angular": {
    "version": "1.0.0",
    "props": {
      "angularVersion": "~1.4.2",
      "angularModules": [
        {
          "key": "animate",
          "module": "ngAnimate"
        },
        {
          "key": "cookies",
          "module": "ngCookies"
        },
        {
          "key": "sanitize",
          "module": "ngSanitize"
        },
        {
          "key": "messages",
          "module": "ngMessages"
        }
      ],
      "jQuery": {
        "key": "jquery2"
      },
      "resource": {
        "key": "angular-resource",
        "module": "ngResource"
      },
      "router": {
        "key": "ui-router",
        "module": "ui.router"
      },
      "ui": {
        "key": "angular-material",
        "module": "ngMaterial"
      },
      "cssPreprocessor": {
        "key": "node-sass",
        "extension": "scss"
      },
      "jsPreprocessor": {
        "key": "typescript",
        "extension": "ts",
        "srcExtension": "ts"
      },
      "htmlPreprocessor": {
        "key": "noHtmlPrepro",
        "extension": "html"
      },
      "bootstrapComponents": {
        "name": null,
        "version": null,
        "key": null,
        "module": null
      },
      "foundationComponents": {
        "name": null,
        "version": null,
        "key": null,
        "module": null
      },
      "paths": {
        "src": "src",
        "dist": "dist",
        "e2e": "e2e",
        "tmp": ".tmp"
      }
    }
  }
}

Update: Removing ng-strict-di allows the page to load, but shouldn't be necessary in a new project.

devonzara avatar Nov 09 '15 15:11 devonzara

Thanks for reporting. Removing ng-strict-di should not be the solution...

Swiip avatar Nov 18 '15 09:11 Swiip

+1 Same issue here

mackelito avatar Feb 29 '16 10:02 mackelito

+1 Seeing this issue on OSX 10.11.5 Chrome 50.0.2661.94 (64-bit) with generator 1.1.0. Cannot replicate in Firefox, Safari, or Chrome on Windows 10. Looks like some kind of race condition depending on the browser state.

claytondus avatar May 02 '16 20:05 claytondus

Any updates on this? Would really love to get started with typescript :)

mackelito avatar May 06 '16 17:05 mackelito