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

Debowerify doesn't seems to work #48

Open
kopax opened this issue Oct 9, 2014 · 3 comments
Open

Debowerify doesn't seems to work #48

kopax opened this issue Oct 9, 2014 · 3 comments

Comments

@kopax
Copy link

kopax commented Oct 9, 2014

I have installed through bower

$ bower install bootstrap-daterangepicker --save-dev

In my app.js, I try to include it with

var rangePicker = require('bootstrap3-daterangepicker');

Please not that the bower_components is into the folder ./client/ but I have a .bowerrc file with

{
"cwd": "client"
}

The bower.json of this library as all the required attributes. (see :
https://github.com/dangrossman/bootstrap-daterangepicker/blob/master/bower.json )

Gulp is in charge to do the browserify bundle for me, but I can't make it work, I always got this error :

[18:06:53] Browserify Error { [Error: Cannot find module 'bootstrap3-daterangepicker' from ...

Any suggestion on how to debug this ?

@goodbomb
Copy link

I'm running into this issue right now with angular. Did you ever find a solution?

@bobthecow
Copy link
Collaborator

Try this:

var rangePicker = require('bootstrap3-daterangepicker/daterangepicker.js');

and see if it works?

@goodbomb
Copy link

I managed to sort out my own issue last. It would seem I was using browserify's "require" method incorrectly. I had upgraded from an earlier version of Browserify and my build broke. I was doing this:

vendorFiles.forEach(function(lib) {
        b.require(lib);
});

But what I actually had to do was this:

var b = browserify({
        require: vendorFiles
});

I was externalizing the vendor files into a separate build and transforming them with debowerify, but I kept getting "Unable to find module 'libs/angular/angular.js' " even though the path resolved correctly. It all works now. Thanks!

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

3 participants