Skip to content
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

WARNING: Tried to load angular more than once #3

Open
AhmadEl-Banna opened this issue Jul 17, 2015 · 12 comments
Open

WARNING: Tried to load angular more than once #3

AhmadEl-Banna opened this issue Jul 17, 2015 · 12 comments

Comments

@AhmadEl-Banna
Copy link

This happens when choose bower support and add package that depends on angular it self
this is related to issue #223 on angular-meteor repo

Suggested fix:
I think it would be perfect if the generator remove the dependency on mquandalle:bower and generate an independent package with mquandalle:bower in case of the user choose to add bower support,
and also add main files of bower to the cleint in package.js

@ndxbxrme
Copy link
Owner

Cheers Ahmad, I'll look into that this evening

@AhmadEl-Banna
Copy link
Author

Thank you very much

@ndxbxrme
Copy link
Owner

I've implemented a fix in v0.10.0 based on @renato's solution in angular-meteor issue #205. It seems to work a treat.
Give it a shot and let me know what you think, then I'll close the issue.

@AhmadEl-Banna
Copy link
Author

Good job I will try it out

@AhmadEl-Banna
Copy link
Author

Works fine thank you.

@johhansantana
Copy link

Hi there, I'm still having this issue, I created a brand new project, then proceed on creating a route, it worked fine, but after I created a second route I get the error:

WARNING: Tried to load angular more than once.
angular.js:12520 Error: [ng:btstrpd] App Already Bootstrapped with this Element 'document'
http://errors.angularjs.org/1.4.8/ng/btstrpd?p0=document
    at http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:91:12
    at doBootstrap (http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:1680:13)
    at Object.bootstrap (http://localhost:3000/packages/angular_angular.js?6d4ee2c049f945acd899d01d101da60606fc5cc8:1720:12)
    at HTMLDocument.onReady (eval at <anonymous> (http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:365:22), <anonymous>:9:11)
    at fire (http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:3169:30)
    at Object.self.add [as done] (http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:3215:7)
    at jQuery.fn.ready (http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:3449:25)
    at eval (eval at <anonymous> (http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:365:22), <anonymous>:15:29)
    at eval (eval at <anonymous> (http://localhost:3000/packages/jquery.js?1015953f785c9b76503e2ecb391507dce965f357:365:22), <anonymous>:17:4)
    at eval (native) <div ui-view="" class="ng-scope">

I have the bower.json file like this:

{
  "name": "testingApp",
  "version": "0.0.0",
  "license": "MIT",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    ".meteor/local/bower",
    "test",
    "tests"
  ],
  "dependencies": {
  },
  "ignoredDependencies": [
    "jquery",
    "angular"
  ],
  "overrides": {
    "angular": {
      "main": [] 
    }
  }
}

but still no fix to the issue.

@donedgardo
Copy link

I can confirm this bug too, once I created the meteor-angular app with bower install options 'Yes'. Creating two consecutive routes with angular-meteor:route 'testroute2'; the first one loads well, where the second one comes up with: Tried to load angular twice error.

@ndxbxrme
Copy link
Owner

I'll look into it

@ndxbxrme
Copy link
Owner

hey guys,
i'm having trouble recreating this issue
which version of the generator are you using and which options are you selecting?

@ndxbxrme ndxbxrme reopened this Jan 10, 2016
@johhansantana
Copy link

I was able to fix it by just making "bower": false in .yo-rc.json file

{
  "generator-angular-meteor": {
    "filters": {
      "js": true,
      "html": true,
      "css": true,
      "pagination": true,
      "framework": "bootstrap",
      "bower": false,
      "auth": true
    },
    "appname": "myApp"
  }
}

How do I verify my current generator version?

@ndxbxrme
Copy link
Owner

that's very interesting.
you can find your version by running

npm list -g generator-angular-meteor

ndxbxrme added a commit that referenced this issue Jan 18, 2016
@ndxbxrme
Copy link
Owner

can you give the latest version (0.20.3) a try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants