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

Doesn't Play Well With Bower #35

Open
Kenkron opened this issue Feb 24, 2017 · 1 comment
Open

Doesn't Play Well With Bower #35

Kenkron opened this issue Feb 24, 2017 · 1 comment

Comments

@Kenkron
Copy link

Kenkron commented Feb 24, 2017

I'm using bower, and as expected, bower install ngclipboard --save installs ngclipboard, and it's dependency, clipboard. However, when loaded with these tags:

    <script type="text/javascript" src="./bower/angular/angular.js"></script>
    <script type="text/javascript" src="./bower/angular-aria/angular-aria.min.js"></script>
    <!--etc.-->
    <script type="text/javascript" src="./bower/clipboard/dist/clipboard.min.js"></script>
    <script type="text/javascript" src="./bower/ngclipboard/dist/ngclipboard.js"></script>

It produces this in the console:

WARNING: Tried to load angular more than once.
module.js:455 Uncaught Error: Cannot find module 'clipboard'

Referencing this code:

    // Check for CommonJS support
    if (typeof module === 'object' && module.exports) {
      angular = require('angular');
      Clipboard = require('clipboard');    //this line in particular
      module.exports = MODULE_NAME;
    } else {
      angular = window.angular;
      Clipboard = window.Clipboard;
    }

If I install using npm, it all works, even if I keep the bower source tags.

The project has node packages in the same directory, including angular, which explains why the log says WARNING: Tried to load angular more than once. instead of something like module.js:454 Uncaught Error: Cannot find module 'angular'.

@hthetiot
Copy link

hthetiot commented Nov 2, 2017

See #37

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

2 participants