jadjoubran / laravel5-angular-material-starter

Get started with Laravel 5.3 and AngularJS (material)
https://laravel-angular.readme.io/
MIT License
1.66k stars 401 forks source link

angular module error on fresh project setup #496

Closed hottehead closed 7 years ago

hottehead commented 7 years ago

I discovered this incompatible sign in the bower dependency list. bildschirmfoto 2017-07-01 um 12 31 09

I tested this because I migrated an older project to a new machine. After fresh dependency installation I got the same error. So I tried installing a fresh project and discovered it produces the same error.

final-42b98a1170.js:sourcemap:47025 Uncaught TypeError: angular.module(...).info is not a function
    at final-42b98a1170.js:sourcemap:47025
    at final-42b98a1170.js:sourcemap:47041
(anonymous) @ final-42b98a1170.js:sourcemap:47025
(anonymous) @ final-42b98a1170.js:sourcemap:47041
final-42b98a1170.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.5.11/$injector/nomod?p0=app
    at http://localhost:8000/build/js/final-42b98a1170.js:68:12
    at http://localhost:8000/build/js/final-42b98a1170.js:2133:17
    at ensure (http://localhost:8000/build/js/final-42b98a1170.js:2057:38)
    at module (http://localhost:8000/build/js/final-42b98a1170.js:2131:14)
    at http://localhost:8000/build/js/final-42b98a1170.js:4669:22
    at forEach (http://localhost:8000/build/js/final-42b98a1170.js:325:20)
    at loadModules (http://localhost:8000/build/js/final-42b98a1170.js:4653:5)
    at createInjector (http://localhost:8000/build/js/final-42b98a1170.js:4575:19)
    at doBootstrap (http://localhost:8000/build/js/final-42b98a1170.js:1809:20)
    at bootstrap (http://localhost:8000/build/js/final-42b98a1170.js:1830:12)
http://errors.angularjs.org/1.5.11/$injector/modulerr?p0=app&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'app'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.5.11%2F%24injector%2Fnomod%3Fp0%3Dapp%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A68%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A2133%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A2057%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A2131%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A4669%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A325%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A4653%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A4575%3A19)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A1809%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A1830%3A12)
    at http://localhost:8000/build/js/final-42b98a1170.js:68:12
    at http://localhost:8000/build/js/final-42b98a1170.js:2133:17
    at ensure (http://localhost:8000/build/js/final-42b98a1170.js:2057:38)
    at module (http://localhost:8000/build/js/final-42b98a1170.js:2131:14)
    at http://localhost:8000/build/js/final-42b98a1170.js:4669:22
    at forEach (http://localhost:8000/build/js/final-42b98a1170.js:325:20)
    at loadModules (http://localhost:8000/build/js/final-42b98a1170.js:4653:5)
    at createInjector (http://localhost:8000/build/js/final-42b98a1170.js:4575:19)
    at doBootstrap (http://localhost:8000/build/js/final-42b98a1170.js:1809:20)
    at bootstrap (http://localhost:8000/build/js/final-42b98a1170.js:1830:12)
http://errors.angularjs.org/1.5.11/$injector/modulerr?p0=app&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'app'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.5.11%2F%24injector%2Fnomod%3Fp0%3Dapp%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A68%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A2133%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A2057%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A2131%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A4669%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A325%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A4653%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A4575%3A19)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A1809%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A8000%2Fbuild%2Fjs%2Ffinal-42b98a1170.js%3A1830%3A12)
    at http://localhost:8000/build/js/final-42b98a1170.js:68:12
    at http://localhost:8000/build/js/final-42b98a1170.js:4692:15
    at forEach (http://localhost:8000/build/js/final-42b98a1170.js:325:20)
    at loadModules (http://localhost:8000/build/js/final-42b98a1170.js:4653:5)
    at createInjector (http://localhost:8000/build/js/final-42b98a1170.js:4575:19)
    at doBootstrap (http://localhost:8000/build/js/final-42b98a1170.js:1809:20)
    at bootstrap (http://localhost:8000/build/js/final-42b98a1170.js:1830:12)
    at angularInit (http://localhost:8000/build/js/final-42b98a1170.js:1715:5)
    at http://localhost:8000/build/js/final-42b98a1170.js:32616:5
    at trigger (http://localhost:8000/build/js/final-42b98a1170.js:3257:7)
(anonymous) @ final-42b98a1170.js:68
(anonymous) @ final-42b98a1170.js:4692
forEach @ final-42b98a1170.js:325
loadModules @ final-42b98a1170.js:4653
createInjector @ final-42b98a1170.js:4575
doBootstrap @ final-42b98a1170.js:1809
bootstrap @ final-42b98a1170.js:1830
angularInit @ final-42b98a1170.js:1715
(anonymous) @ final-42b98a1170.js:32616
trigger @ final-42b98a1170.js:3257
defaultHandlerWrapper @ final-42b98a1170.js:3546
eventHandler @ final-42b98a1170.js:3534
jadjoubran commented 7 years ago

Hi @hottehead This seems to be the issue

So you can fix it as following:

1) remove any resolutions you have in bower.json 2)

rm -rf bower_components
bower install

3) choose the latest version of Angular when asked by bower (the one required by angular-material)

hottehead commented 7 years ago

I have the exact same bower.json like the master branch. I then run rm -rf bower_components && bower install and choose the angular required by angular-material. I then run gulp && gulp watch. Unfortunately the problem persists. I tried this with a fresh installation of this project.

I'll also dig into the link you provided. So far this didnt solve it.

bildschirmfoto 2017-07-10 um 09 21 29

jadjoubran commented 7 years ago

hmm can you try any of the last 4? those that resolve to 1.6.5

hottehead commented 7 years ago

Okay. I redid a bower install and now its working. Dependencies also resolved to a different set. Strange... but it works now. I choose the 8 on this one.

bildschirmfoto 2017-07-10 um 17 14 36