-
Notifications
You must be signed in to change notification settings - Fork 3k
Webpack with angular 1.5 and ui-router 1.0.0-beta.3 causes angular undefined error #3113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@milo- thanks for the link. I think this behavior changed in 71bfaa0 where we now do: Help me understand how we reproduce the behavior Here's a minimal repository which shows webpack working with ui-router I'd really like to fix this, but I need to be able to reproduce it first.
This seems like it should work out of the box with webpack. Can you help me understand why this doesn't work for you? |
Hi @milo- , I got the same error a couple a days ago, and in my case I was playing around with the aliases in Webpack and tried out putting an alias like When I added the ui-router 1.0.0 beta 3, I got the error and I think it is obvious because the angular.min.js is not declared as module in angularjs typings. As I said, I just wanted to see how the aliases worked so I just simply removed the alias and the issue was gone. I hope this helps, but if not, at least be aware that using the minified version of angularjs also causes the same issue. |
Thanks both for getting back to me! It seems to be caused by using bower rather than npm for managing dependencies. I'm guessing the bower version doesn't export the module, so ui-router can't pick it up. I've pushed the failing code into a PR: https://github.com/christopherthielen/ui-router-webpack/pull/1/files I'm going to switch over our to using npm on my side to resolve this. Let me know if I can be any more help. |
👍 thanks @christopherthielen |
👍 Thanks |
Hi Team, |
I have literally no idea. Perhaps try a different CDN http://unpkg.com/[email protected]/release/angular-ui-router.min.js |
Thanks for quick turnaround Christopher. |
@AdityaTandon02 I'd advise you to read over the information provided by unpkg.com about their CDN: https://unpkg.com/#/about then you can make that decision for yourself. |
When updating from beta.2 to beta.3 I get an error saying
angular-ui-router.js:6625 Uncaught TypeError: angular.module is not a function
I'm using webpack with angular 1.5.
I believe the issue might be caused by angular not working exporting itself correctly: http://stackoverflow.com/questions/35571090/why-requireangular-returns-an-empty-object
I think this is the same issue reported by @elesdoar
The text was updated successfully, but these errors were encountered: