angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Failed to instantiate module... again #2353

Open AmirGilboa opened 7 years ago

AmirGilboa commented 7 years ago
Item Version
generator-angular-fullstack 4.1.0
Operating System Windows 10
etc etc
Item Answer
Transpiler Babel
etc etc

trying to work with ag-grid, from www.ag-grid.com installing it with npm, it is in my node_modules, looks ok. then i add to my app.js the import as they say in the getting started:

// ECMA 6 - using the system import method
import {Grid} from 'ag-grid/main';

then i add my new import to my module line:

angular.module('app', [ngCookies, ngResource, ngSanitize, uiRouter, Grid])
angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module undefined due to:
Error: [ng:areq] Argument 'module' is not a function, got undefined
http://errors.angularjs.org/1.5.8/ng/areq?p0=module&p1=not%20a%20function%2C%20got%20undefined
    at http://localhost:3000/vendor.bundle.js:194:13
    at assertArg (http://localhost:3000/vendor.bundle.js:2018:12)
    at assertArgFn (http://localhost:3000/vendor.bundle.js:2028:4)
    at http://localhost:3000/vendor.bundle.js:4752:12
    at forEach (http://localhost:3000/vendor.bundle.js:447:21)
    at loadModules (http://localhost:3000/vendor.bundle.js:4727:6)
    at http://localhost:3000/vendor.bundle.js:4744:41

Any help would be greatly appreciated.

Awk34 commented 7 years ago

One of your modules that you're trying to depend on there is undefined. Debug which one is coming out to be undefined. I would assume that it's theGrid` one. You need to see how that module exports it's Angular name, if it does at all. It might not, in which you'd need to just add the name string in your dependency array.