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

npm require misses hammerjs, then picker.js, etc ... #1422

Closed
joergd opened this Issue May 25, 2015 · 62 comments

Comments

Projects
None yet
@joergd

joergd commented May 25, 2015

When I use the npm module,

a) I cannot require it directly as referenced in my package.json file - I need to use a path to the node_modules/materialize-css/bin folder.

b) then when I require the materialize.js file from that node_modules location, it misses hammerjs

c) then I get hammerjs, then it is missing picker.js etc ...

I'm not sure where I am going wrong here, but I am finding it impossible to require('materialize-css') in my browserify app ... :(

Am I doing something wrong?

@ktmn

This comment has been minimized.

Show comment
Hide comment
@ktmn

ktmn May 29, 2015

Same here.

import Materialize from '../node_modules/materialize-css/bin/materialize.js';

or

let Materialize = require('../node_modules/materialize-css/bin/materialize.js');

produces

[16:17:47] gulp-notify: [Error running Gulp] Cannot find module './picker.js' from 'C:\...\node_modules\materialize-css\bin'
[16:17:48] gulp-notify: [Error running Gulp] Cannot find module 'hammerjs' from 'C:\...\node_modules\materialize-css\bin'

ktmn commented May 29, 2015

Same here.

import Materialize from '../node_modules/materialize-css/bin/materialize.js';

or

let Materialize = require('../node_modules/materialize-css/bin/materialize.js');

produces

[16:17:47] gulp-notify: [Error running Gulp] Cannot find module './picker.js' from 'C:\...\node_modules\materialize-css\bin'
[16:17:48] gulp-notify: [Error running Gulp] Cannot find module 'hammerjs' from 'C:\...\node_modules\materialize-css\bin'
@Riuujin

This comment has been minimized.

Show comment
Hide comment
@Riuujin

Riuujin Jun 15, 2015

same here

Riuujin commented Jun 15, 2015

same here

@Nxt3

This comment has been minimized.

Show comment
Hide comment
@Nxt3

Nxt3 Jul 29, 2015

I can't even do var materialize = require('materialize-css'); in my node.js app. Does anyone have a work around? I ran npm install materialize-css --save and it doesn't work. (I also tried a direct path to the bin in the module, but that didn't work either).

Nxt3 commented Jul 29, 2015

I can't even do var materialize = require('materialize-css'); in my node.js app. Does anyone have a work around? I ran npm install materialize-css --save and it doesn't work. (I also tried a direct path to the bin in the module, but that didn't work either).

@choonchernlim

This comment has been minimized.

Show comment
Hide comment
@choonchernlim

choonchernlim Jul 29, 2015

Agreed. Is there a npm module for picker.js?

choonchernlim commented Jul 29, 2015

Agreed. Is there a npm module for picker.js?

@danazkari

This comment has been minimized.

Show comment
Hide comment
@danazkari

danazkari Jul 30, 2015

npm install materialize-css -D works but require('materialize-css') doesn't.... this is a bummer! How are we supposed to use the npm version of it?

danazkari commented Jul 30, 2015

npm install materialize-css -D works but require('materialize-css') doesn't.... this is a bummer! How are we supposed to use the npm version of it?

@ndesorden

This comment has been minimized.

Show comment
Hide comment
@ndesorden

ndesorden Jul 31, 2015

For hammerjs you can: npm install hammerjs --save
For picker you can: npm install pickadate --save and change in materialize.js
require('./picker.js') to require(''../'../pickadate/lib/picker.js')

 ;/*!
 * Date picker for pickadate.js v3.5.0
 * http://amsul.github.io/pickadate.js/date.htm
 */

 (function ( factory ) {

// AMD.
if ( typeof define == 'function' && define.amd )
    define( ['picker', 'jquery'], factory )

// Node.js/browserify.
else if ( typeof exports == 'object' )
    module.exports = factory( require('./picker.js'), require('jquery') )  <- change here

// Browser globals.
else factory( Picker, jQuery )

}(function( Picker, $ ) {

Yes, not very elegant :( until materialize team put hammer and pickeradate as dependencies in package.json

ndesorden commented Jul 31, 2015

For hammerjs you can: npm install hammerjs --save
For picker you can: npm install pickadate --save and change in materialize.js
require('./picker.js') to require(''../'../pickadate/lib/picker.js')

 ;/*!
 * Date picker for pickadate.js v3.5.0
 * http://amsul.github.io/pickadate.js/date.htm
 */

 (function ( factory ) {

// AMD.
if ( typeof define == 'function' && define.amd )
    define( ['picker', 'jquery'], factory )

// Node.js/browserify.
else if ( typeof exports == 'object' )
    module.exports = factory( require('./picker.js'), require('jquery') )  <- change here

// Browser globals.
else factory( Picker, jQuery )

}(function( Picker, $ ) {

Yes, not very elegant :( until materialize team put hammer and pickeradate as dependencies in package.json

@angusfretwell

This comment has been minimized.

Show comment
Hide comment
@angusfretwell

angusfretwell Aug 7, 2015

This really needs to be fixed, will not use the project because of it.

angusfretwell commented Aug 7, 2015

This really needs to be fixed, will not use the project because of it.

@jackmew

This comment has been minimized.

Show comment
Hide comment
@jackmew

jackmew Aug 15, 2015

+1 Uncaught Error: Cannot find module 'hammerjs'

jackmew commented Aug 15, 2015

+1 Uncaught Error: Cannot find module 'hammerjs'

@rogue780

This comment has been minimized.

Show comment
Hide comment
@rogue780

rogue780 Aug 25, 2015

+1. I'm actually going back to bootstrap due to this issue.

rogue780 commented Aug 25, 2015

+1. I'm actually going back to bootstrap due to this issue.

@kengorab

This comment has been minimized.

Show comment
Hide comment
@kengorab

kengorab Sep 4, 2015

The whole concatenated file should be wrapped in a umd module. I'm trying to use this module with webpack and it cannot find jQuery or $ when trying to run it in the browser. I edited the materialize.js file within my node_modules to include var $ = jQuery = require('jquery); and it works fine, as expected. There's almost definitely a task for Grunt (there's one for gulp) in which you declare your module's dependencies, and outputs a umd-wrapped concatenated module. This is a must when using this project in any other context than manually putting script tags on the page.

When I get the time (maybe this weekend) I'll see if I can put together a pull request for it. I really want to use this module, and don't want to rely on editing the module file every time.

kengorab commented Sep 4, 2015

The whole concatenated file should be wrapped in a umd module. I'm trying to use this module with webpack and it cannot find jQuery or $ when trying to run it in the browser. I edited the materialize.js file within my node_modules to include var $ = jQuery = require('jquery); and it works fine, as expected. There's almost definitely a task for Grunt (there's one for gulp) in which you declare your module's dependencies, and outputs a umd-wrapped concatenated module. This is a must when using this project in any other context than manually putting script tags on the page.

When I get the time (maybe this weekend) I'll see if I can put together a pull request for it. I really want to use this module, and don't want to rely on editing the module file every time.

@kengorab

This comment has been minimized.

Show comment
Hide comment
@kengorab

kengorab Sep 5, 2015

So apparently webpack has a shimming capability that I didn't know about, allowing you to provide it dependencies that aren't explicitly required in within the module. I don't know about the rest of you all, but I'd check to see if such a solution exists for you.

Granted, this project should be a more well-defined module.

kengorab commented Sep 5, 2015

So apparently webpack has a shimming capability that I didn't know about, allowing you to provide it dependencies that aren't explicitly required in within the module. I don't know about the rest of you all, but I'd check to see if such a solution exists for you.

Granted, this project should be a more well-defined module.

@Itagiba

This comment has been minimized.

Show comment
Hide comment
@Itagiba

Itagiba Sep 30, 2015

Is anyone still having this problem? This stupid "picker.js" can't be placed anywhere, it doesn't get found!

Itagiba commented Sep 30, 2015

Is anyone still having this problem? This stupid "picker.js" can't be placed anywhere, it doesn't get found!

@neverfox

This comment has been minimized.

Show comment
Hide comment
@neverfox

neverfox Oct 3, 2015

Yes, I cannot use this library because it defaults to an attempt to find ./picker rather than relying on an npm peer dependency.

neverfox commented Oct 3, 2015

Yes, I cannot use this library because it defaults to an attempt to find ./picker rather than relying on an npm peer dependency.

@kmuncie

This comment has been minimized.

Show comment
Hide comment
@kmuncie

kmuncie Nov 18, 2015

This is terrible. Likely going to scrap using this entire project because it just isn't setup properly at all...

kmuncie commented Nov 18, 2015

This is terrible. Likely going to scrap using this entire project because it just isn't setup properly at all...

@davestevens

This comment has been minimized.

Show comment
Hide comment
@davestevens

davestevens Nov 19, 2015

For a work around you can use materialize with browserify-shim to stop this error.

davestevens commented Nov 19, 2015

For a work around you can use materialize with browserify-shim to stop this error.

@rogue780

This comment has been minimized.

Show comment
Hide comment
@rogue780

rogue780 Nov 19, 2015

I could never get it to work properly with browserify-shim.

rogue780 commented Nov 19, 2015

I could never get it to work properly with browserify-shim.

@davestevens

This comment has been minimized.

Show comment
Hide comment
@davestevens

davestevens Nov 19, 2015

This is what I've got setup and i'm able to build the js and get it working.

package.json

  "browserify": {
    "transform": [
      "browserify-shim"
    ]
  },
  "browser": {
    "jquery": "./node_modules/jquery/dist/jquery.js",
    "materialize": "./node_modules/materialize-css/bin/materialize.js"
  },
  "browserify-shim": {
    "jquery": "$",
    "materialize": "materialize"
  }

requiring in a .js file

var $ = require("jquery"),
    materialize = require("materialize");

davestevens commented Nov 19, 2015

This is what I've got setup and i'm able to build the js and get it working.

package.json

  "browserify": {
    "transform": [
      "browserify-shim"
    ]
  },
  "browser": {
    "jquery": "./node_modules/jquery/dist/jquery.js",
    "materialize": "./node_modules/materialize-css/bin/materialize.js"
  },
  "browserify-shim": {
    "jquery": "$",
    "materialize": "materialize"
  }

requiring in a .js file

var $ = require("jquery"),
    materialize = require("materialize");
@idmontie

This comment has been minimized.

Show comment
Hide comment
@idmontie

idmontie Nov 28, 2015

👍 I am not able to load in the Javascript portion into my project using require('materialize-css) because hammer.js could not be found.

If I require('materialize-css/js/init.js'), pushpin ends up being undefined (and init.js does not export any variables).

Is there an actual entry point to the Javascript portion, or does the Gulpfile just concat everything together?

idmontie commented Nov 28, 2015

👍 I am not able to load in the Javascript portion into my project using require('materialize-css) because hammer.js could not be found.

If I require('materialize-css/js/init.js'), pushpin ends up being undefined (and init.js does not export any variables).

Is there an actual entry point to the Javascript portion, or does the Gulpfile just concat everything together?

@idmontie

This comment has been minimized.

Show comment
Hide comment
@idmontie

idmontie Nov 28, 2015

Workaround:

Install hammer:

npm install --save-dev hammerjs

Make sure jQuery is required if you are not already requiring it:

window.jQuery = require('jquery');
require('materialize-css/dist/js/materialize.js');

If you are using jQuery in noConflict mode, then the following will still fail:

var Vel;
if ($) {
  Vel = $.Velocity;
}
else {
  Vel = Velocity;
}

You can replace it with the following to get to work:

var Vel;
if (jQuery) {
  Vel = jQuery.Velocity;
}
else {
  Vel = Velocity;
}

idmontie commented Nov 28, 2015

Workaround:

Install hammer:

npm install --save-dev hammerjs

Make sure jQuery is required if you are not already requiring it:

window.jQuery = require('jquery');
require('materialize-css/dist/js/materialize.js');

If you are using jQuery in noConflict mode, then the following will still fail:

var Vel;
if ($) {
  Vel = $.Velocity;
}
else {
  Vel = Velocity;
}

You can replace it with the following to get to work:

var Vel;
if (jQuery) {
  Vel = jQuery.Velocity;
}
else {
  Vel = Velocity;
}
@acburst

This comment has been minimized.

Show comment
Hide comment
@acburst

acburst Nov 28, 2015

Collaborator

I just added in that case here 67c93cf

Collaborator

acburst commented Nov 28, 2015

I just added in that case here 67c93cf

@NelsonCrosby

This comment has been minimized.

Show comment
Hide comment
@NelsonCrosby

NelsonCrosby Nov 29, 2015

@idmontie There's still the issue of "./picker.js" not being found.

I've got a hack at SourceComb/materialize (sc-hack branch; diff), which I'm handling as a git submodule for now. I'm don't think it's really so much a fix as a hack, but it works with browserify for now. The branch is based on v0.97.3 (not master).

NelsonCrosby commented Nov 29, 2015

@idmontie There's still the issue of "./picker.js" not being found.

I've got a hack at SourceComb/materialize (sc-hack branch; diff), which I'm handling as a git submodule for now. I'm don't think it's really so much a fix as a hack, but it works with browserify for now. The branch is based on v0.97.3 (not master).

@isaachinman

This comment has been minimized.

Show comment
Hide comment
@isaachinman

isaachinman Jan 12, 2016

Picker still isn't working in the npm package. Any plans to fix this?

isaachinman commented Jan 12, 2016

Picker still isn't working in the npm package. Any plans to fix this?

@ScoutsOut

This comment has been minimized.

Show comment
Hide comment
@ScoutsOut

ScoutsOut Jan 23, 2016

We resolved the issue with missing dependencies by using the following configuration:
Please note that we are pointing to '/bin/' vs '/dist/'

"browser": {
"materialize": "./node_modules/materialize-css/bin/materialize.js"
},
"browserify-shim": {
"materialize": {
"exports": "materialize"
},

ScoutsOut commented Jan 23, 2016

We resolved the issue with missing dependencies by using the following configuration:
Please note that we are pointing to '/bin/' vs '/dist/'

"browser": {
"materialize": "./node_modules/materialize-css/bin/materialize.js"
},
"browserify-shim": {
"materialize": {
"exports": "materialize"
},

@damon-rand

This comment has been minimized.

Show comment
Hide comment
@damon-rand

damon-rand Jan 27, 2016

+1 - but can confirm that the browserify shim solutions by @davestevens and @bkd work.

damon-rand commented Jan 27, 2016

+1 - but can confirm that the browserify shim solutions by @davestevens and @bkd work.

@WeiJieGitHub

This comment has been minimized.

Show comment
Hide comment
@WeiJieGitHub

WeiJieGitHub Feb 17, 2016

same here, so sad :(

WeiJieGitHub commented Feb 17, 2016

same here, so sad :(

@danielberkompas

This comment has been minimized.

Show comment
Hide comment
@danielberkompas

danielberkompas Feb 22, 2016

+1. Same problem using Brunch's NPM integration.

danielberkompas commented Feb 22, 2016

+1. Same problem using Brunch's NPM integration.

@odb366

This comment has been minimized.

Show comment
Hide comment
@odb366

odb366 Mar 30, 2016

+1 problem occured after updating to Meteor 1.3

odb366 commented Mar 30, 2016

+1 problem occured after updating to Meteor 1.3

@jschlieber

This comment has been minimized.

Show comment
Hide comment
@jschlieber

jschlieber Apr 2, 2016

+1 Can't use npm version with Meteor 1.3.
Module ./picker.js is not found. Would be nice to have an out of the box working npm version...

jschlieber commented Apr 2, 2016

+1 Can't use npm version with Meteor 1.3.
Module ./picker.js is not found. Would be nice to have an out of the box working npm version...

@meowoow

This comment has been minimized.

Show comment
Hide comment
@meowoow

meowoow Apr 11, 2016

+1, still have the same problem with Meteor 1.3.1

meowoow commented Apr 11, 2016

+1, still have the same problem with Meteor 1.3.1

@xwilders

This comment has been minimized.

Show comment
Hide comment
@xwilders

xwilders Apr 14, 2016

Is there any plan or ETA on a working npm import?
As far as I know all it involves is adding the pickadate dependancy to package.json, or copying the file manually like @NelsonCrosby did.

xwilders commented Apr 14, 2016

Is there any plan or ETA on a working npm import?
As far as I know all it involves is adding the pickadate dependancy to package.json, or copying the file manually like @NelsonCrosby did.

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn May 5, 2016

This is still an opened issue. Why is it still not fixed?

sobolevn commented May 5, 2016

This is still an opened issue. Why is it still not fixed?

@voodooattack

This comment has been minimized.

Show comment
Hide comment
@voodooattack

voodooattack May 5, 2016

Please.. I've been tearing my hair out over this for the past three hours with no fix at hand.

voodooattack commented May 5, 2016

Please.. I've been tearing my hair out over this for the past three hours with no fix at hand.

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn May 5, 2016

I have been using brunch. The workaround for me was:

  1. install the same lib with bower
  2. add file from bower to before section
  3. add path to scss folder in sass section (optional)

Still very disappointed.

sobolevn commented May 5, 2016

I have been using brunch. The workaround for me was:

  1. install the same lib with bower
  2. add file from bower to before section
  3. add path to scss folder in sass section (optional)

Still very disappointed.

@pikausp

This comment has been minimized.

Show comment
Hide comment
@pikausp

pikausp May 25, 2016

The problem (at least in my case) was following

  • file materialize.js is located at path ./bin/materialize.js
  • file picker.js is located at path ./date_picker/picker.js
  • materialize.js tries to require picker specificing the current directory (require('./picker.js')) so I replaced the require string with '../date_picker/picker.js'

And everything works as expected

pikausp commented May 25, 2016

The problem (at least in my case) was following

  • file materialize.js is located at path ./bin/materialize.js
  • file picker.js is located at path ./date_picker/picker.js
  • materialize.js tries to require picker specificing the current directory (require('./picker.js')) so I replaced the require string with '../date_picker/picker.js'

And everything works as expected

@claytonmarinho

This comment has been minimized.

Show comment
Hide comment
@claytonmarinho

claytonmarinho Jun 1, 2016

To me works almost like pikaupet's solution.

example my app main.js:

import '../imports/client/templates/app';
import '../imports/router';
require('materialize-css/dist/js/materialize.js');
  • css at html header

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">

I had to change the line 5081 at dist/js/materialize.js to:
module.exports = factory( require('../../js/date_picker/picker.js'), require('jquery') )

claytonmarinho commented Jun 1, 2016

To me works almost like pikaupet's solution.

example my app main.js:

import '../imports/client/templates/app';
import '../imports/router';
require('materialize-css/dist/js/materialize.js');
  • css at html header

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">

I had to change the line 5081 at dist/js/materialize.js to:
module.exports = factory( require('../../js/date_picker/picker.js'), require('jquery') )

@carlosbaraza

This comment has been minimized.

Show comment
Hide comment
@carlosbaraza

carlosbaraza Jul 21, 2016

For people using meteor, instead of requiring the dist, do:

import 'materialize-css/js/materialize.js';

That will require everything it needs.

carlosbaraza commented Jul 21, 2016

For people using meteor, instead of requiring the dist, do:

import 'materialize-css/js/materialize.js';

That will require everything it needs.

@praneybehl

This comment has been minimized.

Show comment
Hide comment
@praneybehl

praneybehl Jul 22, 2016

@carlosbaraza what version of meteor you using?
Also I just tried the above but I don't get the error anymore but also its not initialized, so I went ahead and opened the file it its all commented out. Here:

// @codekit-prepend "jquery.easing.1.3.js";
// @codekit-prepend "velocity.min.js";
// @codekit-prepend "hammer.min.js";
// @codekit-prepend "jquery.hammer.js";
// @codekit-prepend "collapsible.js";
// @codekit-prepend "dropdown.js";
// @codekit-prepend "leanModal.js";
// @codekit-prepend "materialbox.js";
// @codekit-prepend "parallax.js";
// @codekit-prepend "tabs.js";
// @codekit-prepend "tooltip.js";
// @codekit-prepend "waves.js";
// @codekit-prepend "toasts.js";
// @codekit-prepend "sideNav.js";
// @codekit-prepend "scrollspy.js";
// @codekit-prepend "forms.js";
// @codekit-prepend "slider.js";
// @codekit-prepend "date_picker/picker.js";
// @codekit-prepend "date_picker/picker.date.js";

praneybehl commented Jul 22, 2016

@carlosbaraza what version of meteor you using?
Also I just tried the above but I don't get the error anymore but also its not initialized, so I went ahead and opened the file it its all commented out. Here:

// @codekit-prepend "jquery.easing.1.3.js";
// @codekit-prepend "velocity.min.js";
// @codekit-prepend "hammer.min.js";
// @codekit-prepend "jquery.hammer.js";
// @codekit-prepend "collapsible.js";
// @codekit-prepend "dropdown.js";
// @codekit-prepend "leanModal.js";
// @codekit-prepend "materialbox.js";
// @codekit-prepend "parallax.js";
// @codekit-prepend "tabs.js";
// @codekit-prepend "tooltip.js";
// @codekit-prepend "waves.js";
// @codekit-prepend "toasts.js";
// @codekit-prepend "sideNav.js";
// @codekit-prepend "scrollspy.js";
// @codekit-prepend "forms.js";
// @codekit-prepend "slider.js";
// @codekit-prepend "date_picker/picker.js";
// @codekit-prepend "date_picker/picker.date.js";

@carlosbaraza

This comment has been minimized.

Show comment
Hide comment
@carlosbaraza

carlosbaraza Jul 22, 2016

You are right, I assumed it was working because I received no errors. Sorry
about that.

Maybe requiring all the files could work?

I'll try tonight.

On 22 Jul 2016 04:24, "Praney Behl" notifications@github.com wrote:

@carlosbaraza https://github.com/carlosbaraza what version of meteor
you using?
Also I just tried the about but still get the error, so I went ahead and
opened the file it its all commented out.

// @codekit-prepend "jquery.easing.1.3.js";
// @codekit-prepend "velocity.min.js";
// @codekit-prepend "hammer.min.js";
// @codekit-prepend "jquery.hammer.js";
// @codekit-prepend "collapsible.js";
// @codekit-prepend "dropdown.js";
// @codekit-prepend "leanModal.js";
// @codekit-prepend "materialbox.js";
// @codekit-prepend "parallax.js";
// @codekit-prepend "tabs.js";
// @codekit-prepend "tooltip.js";
// @codekit-prepend "waves.js";
// @codekit-prepend "toasts.js";
// @codekit-prepend "sideNav.js";
// @codekit-prepend "scrollspy.js";
// @codekit-prepend "forms.js";
// @codekit-prepend "slider.js";
// @codekit-prepend "date_picker/picker.js";
// @codekit-prepend "date_picker/picker.date.js";


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1422 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABNimUK4DPJBN85PrTO4lEEBAKJHpvX4ks5qYDgBgaJpZM4Eov0V
.

carlosbaraza commented Jul 22, 2016

You are right, I assumed it was working because I received no errors. Sorry
about that.

Maybe requiring all the files could work?

I'll try tonight.

On 22 Jul 2016 04:24, "Praney Behl" notifications@github.com wrote:

@carlosbaraza https://github.com/carlosbaraza what version of meteor
you using?
Also I just tried the about but still get the error, so I went ahead and
opened the file it its all commented out.

// @codekit-prepend "jquery.easing.1.3.js";
// @codekit-prepend "velocity.min.js";
// @codekit-prepend "hammer.min.js";
// @codekit-prepend "jquery.hammer.js";
// @codekit-prepend "collapsible.js";
// @codekit-prepend "dropdown.js";
// @codekit-prepend "leanModal.js";
// @codekit-prepend "materialbox.js";
// @codekit-prepend "parallax.js";
// @codekit-prepend "tabs.js";
// @codekit-prepend "tooltip.js";
// @codekit-prepend "waves.js";
// @codekit-prepend "toasts.js";
// @codekit-prepend "sideNav.js";
// @codekit-prepend "scrollspy.js";
// @codekit-prepend "forms.js";
// @codekit-prepend "slider.js";
// @codekit-prepend "date_picker/picker.js";
// @codekit-prepend "date_picker/picker.date.js";


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1422 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABNimUK4DPJBN85PrTO4lEEBAKJHpvX4ks5qYDgBgaJpZM4Eov0V
.

@1ns1d3r

This comment has been minimized.

Show comment
Hide comment
@1ns1d3r

1ns1d3r Jul 27, 2016

for picker.js I did in file

node_modules/materialize-css/bin/materialize.js

search and replace using my editor I do ./picker.js find and replace with ./../js/date_picker/picker.js

1ns1d3r commented Jul 27, 2016

for picker.js I did in file

node_modules/materialize-css/bin/materialize.js

search and replace using my editor I do ./picker.js find and replace with ./../js/date_picker/picker.js

@praneybehl

This comment has been minimized.

Show comment
Hide comment
@praneybehl

praneybehl Jul 27, 2016

@michaelmax28 that is not a reliable solution since your node_modules are only limited to your dev environment.

praneybehl commented Jul 27, 2016

@michaelmax28 that is not a reliable solution since your node_modules are only limited to your dev environment.

@nahtnam

This comment has been minimized.

Show comment
Hide comment
@nahtnam

nahtnam Jul 29, 2016

My solution was to add a postinstall script inside my package.json that runs "ln -s ../js/date_picker/picker.js node_modules/materialize-css/bin/picker.js"

nahtnam commented Jul 29, 2016

My solution was to add a postinstall script inside my package.json that runs "ln -s ../js/date_picker/picker.js node_modules/materialize-css/bin/picker.js"

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Aug 7, 2016

@nahtnam can you walk me through how you did that? Having similar issue

ghost commented Aug 7, 2016

@nahtnam can you walk me through how you did that? Having similar issue

@nahtnam

This comment has been minimized.

Show comment
Hide comment
@nahtnam

nahtnam Aug 7, 2016

Add:

"postinstall": "ln -s ../js/date_picker/picker.js node_modules/materialize-css/bin/picker.js",

to your package.json inside the scripts part.

nahtnam commented Aug 7, 2016

Add:

"postinstall": "ln -s ../js/date_picker/picker.js node_modules/materialize-css/bin/picker.js",

to your package.json inside the scripts part.

@di3goleite

This comment has been minimized.

Show comment
Hide comment
@di3goleite

di3goleite Aug 7, 2016

Thank you @nahtnam . This fixed my issue. :D

di3goleite commented Aug 7, 2016

Thank you @nahtnam . This fixed my issue. :D

@nahtnam

This comment has been minimized.

Show comment
Hide comment
@nahtnam

nahtnam Aug 7, 2016

No problem. Few extra notes here:

  • This is a workaround, not a solution so therefore this issue should remain open
  • The postinstall script will only run after you run npm install, therefore once you add the line to your package.json, you must run npm install again.
  • This will not work on windows (I think)

nahtnam commented Aug 7, 2016

No problem. Few extra notes here:

  • This is a workaround, not a solution so therefore this issue should remain open
  • The postinstall script will only run after you run npm install, therefore once you add the line to your package.json, you must run npm install again.
  • This will not work on windows (I think)
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Aug 7, 2016

Thanks I tried it but I realized that since I have a windows machine its not working. What I am trying to do is run https://github.com/rhkina/meteor-materialize-parallax-template because I am not able to find a solution to running the template.

ghost commented Aug 7, 2016

Thanks I tried it but I realized that since I have a windows machine its not working. What I am trying to do is run https://github.com/rhkina/meteor-materialize-parallax-template because I am not able to find a solution to running the template.

@mayashavin

This comment has been minimized.

Show comment
Hide comment
@mayashavin

mayashavin Sep 1, 2016

is this issue fixed anywhere? Still got the problem of wrong location for picker.js. Can anyone fix it finally?
I'm trying to require materialize css using browserify and it can't be done as require('./picker.js') is still missing. Happens also if i use bower :(

mayashavin commented Sep 1, 2016

is this issue fixed anywhere? Still got the problem of wrong location for picker.js. Can anyone fix it finally?
I'm trying to require materialize css using browserify and it can't be done as require('./picker.js') is still missing. Happens also if i use bower :(

@romariolopezc

This comment has been minimized.

Show comment
Hide comment

romariolopezc commented Sep 2, 2016

+1

@boris-jensen

This comment has been minimized.

Show comment
Hide comment
@boris-jensen

boris-jensen Sep 6, 2016

I did almost the same thing as @nahtnam for picker.js, installed this in my scripts in package.json

"postinstall": "ln -f node_modules/materialize-css/js/date_picker/picker.js node_modules/materialize-css/js/date_picker/picker.date.js node_modules/materialize-css/dist/js/"

the -f makes it so that it so that you can do npm install repeatedly without error, and I removed the -s since I couldn't get it to work with only symbolic links

boris-jensen commented Sep 6, 2016

I did almost the same thing as @nahtnam for picker.js, installed this in my scripts in package.json

"postinstall": "ln -f node_modules/materialize-css/js/date_picker/picker.js node_modules/materialize-css/js/date_picker/picker.date.js node_modules/materialize-css/dist/js/"

the -f makes it so that it so that you can do npm install repeatedly without error, and I removed the -s since I couldn't get it to work with only symbolic links

@daywong1119

This comment has been minimized.

Show comment
Hide comment
@daywong1119

daywong1119 Sep 15, 2016

+1 currently use solution by @davestevens

daywong1119 commented Sep 15, 2016

+1 currently use solution by @davestevens

@RyanZim

This comment has been minimized.

Show comment
Hide comment
@RyanZim

RyanZim Sep 29, 2016

Hate to create more +1 noise, but this is really a game-breaker.

RyanZim commented Sep 29, 2016

Hate to create more +1 noise, but this is really a game-breaker.

@vineetp13

This comment has been minimized.

Show comment
Hide comment
@vineetp13

vineetp13 Oct 20, 2016

picker.js issue still happening with meteor 1.4.0.1
(my project was working fine before, but i had to reinstall meteor due to anothe issue, and this problem is showing up now)

vineetp13 commented Oct 20, 2016

picker.js issue still happening with meteor 1.4.0.1
(my project was working fine before, but i had to reinstall meteor due to anothe issue, and this problem is showing up now)

@vineetp13

This comment has been minimized.

Show comment
Hide comment
@vineetp13

vineetp13 Oct 20, 2016

not having issue, i provided meteor command in dir above the project root dir :-/

vineetp13 commented Oct 20, 2016

not having issue, i provided meteor command in dir above the project root dir :-/

@Luckino

This comment has been minimized.

Show comment
Hide comment
@Luckino

Luckino Nov 7, 2016

Thids issue still happening with nodejs

I try to copy the file picker.js to bin folder and it works

Luckino commented Nov 7, 2016

Thids issue still happening with nodejs

I try to copy the file picker.js to bin folder and it works

@NitroBAY

This comment has been minimized.

Show comment
Hide comment
@NitroBAY

NitroBAY Mar 5, 2017

@Dogfalo do you think this is going to be fixed this ?
I may create a PR. This doesn't seem hard to fix. It's a bit surprising you didn't fix it earlier to be honest. The require('./picker.js') even tough there's litteraly no picker.js in /bin or in /dist/js is a pretty obvious error.
Either put picker as a dependency and require('picker') either require a file that exist. Two possibility require(''../'../pickadate/lib/picker.js') or put picker.js in the bin folder and in the dist/js.
The bug here is kinda obvious and it would have been a brainless fix to do. Besides it's a pretty major issue as the npm packages simply cannot work at all w/ this bug. So it's surprising it hasn't been fixed already. Anyway I'm gonna make a PR.

NitroBAY commented Mar 5, 2017

@Dogfalo do you think this is going to be fixed this ?
I may create a PR. This doesn't seem hard to fix. It's a bit surprising you didn't fix it earlier to be honest. The require('./picker.js') even tough there's litteraly no picker.js in /bin or in /dist/js is a pretty obvious error.
Either put picker as a dependency and require('picker') either require a file that exist. Two possibility require(''../'../pickadate/lib/picker.js') or put picker.js in the bin folder and in the dist/js.
The bug here is kinda obvious and it would have been a brainless fix to do. Besides it's a pretty major issue as the npm packages simply cannot work at all w/ this bug. So it's surprising it hasn't been fixed already. Anyway I'm gonna make a PR.

@idmontie

This comment has been minimized.

Show comment
Hide comment
@idmontie

idmontie Mar 5, 2017

Shouldn't these type of dependencies be peerDependencies anyway? That way they can be upgraded without having to upgrade this repo?

idmontie commented Mar 5, 2017

Shouldn't these type of dependencies be peerDependencies anyway? That way they can be upgraded without having to upgrade this repo?

@NitroBAY

This comment has been minimized.

Show comment
Hide comment
@NitroBAY

NitroBAY Mar 5, 2017

Finally I'm unsure about making a PR. Because I don't know how the gruntfile is organized. I don't know how to use it actually.

NitroBAY commented Mar 5, 2017

Finally I'm unsure about making a PR. Because I don't know how the gruntfile is organized. I don't know how to use it actually.

@Thanood

This comment has been minimized.

Show comment
Hide comment
@Thanood

Thanood Mar 29, 2017

From my (limited) experience with webpack, requirejs and reading browserify issues, I think that "shimming" Materialize to explicitly require jquery and in turn forcing the app to only have one single jquery instance might solve this issue. Just like here: #923 (comment)

I'm not sure how to handle this but maybe someone with more insight can use this as a hint.

Thanood commented Mar 29, 2017

From my (limited) experience with webpack, requirejs and reading browserify issues, I think that "shimming" Materialize to explicitly require jquery and in turn forcing the app to only have one single jquery instance might solve this issue. Just like here: #923 (comment)

I'm not sure how to handle this but maybe someone with more insight can use this as a hint.

@nimonian

This comment has been minimized.

Show comment
Hide comment
@nimonian

nimonian May 21, 2017

In 2017: Error: Cannot find module './picker.js' from '.../whatever/node_modules/materialize-css/bin'

nimonian commented May 21, 2017

In 2017: Error: Cannot find module './picker.js' from '.../whatever/node_modules/materialize-css/bin'

Repository owner deleted a comment from jfl1977 Jun 10, 2017

@tomscholz

This comment has been minimized.

Show comment
Hide comment
@tomscholz

tomscholz Jun 10, 2017

Contributor

I am going to close and lock this issue for now, since everyone is just writing "+1"! BTW, writing "+1" doesn't do anything. Please use GitHubs reactions feature instead. @NitroBAY you mentioned, that you wanted to make a PR. Are you still working on that? Please use this issue for discussions around the picker.js issue.

Contributor

tomscholz commented Jun 10, 2017

I am going to close and lock this issue for now, since everyone is just writing "+1"! BTW, writing "+1" doesn't do anything. Please use GitHubs reactions feature instead. @NitroBAY you mentioned, that you wanted to make a PR. Are you still working on that? Please use this issue for discussions around the picker.js issue.

@tomscholz tomscholz closed this Jun 10, 2017

Repository owner locked and limited conversation to collaborators Jun 10, 2017

@tomscholz

This comment has been minimized.

Show comment
Hide comment
@tomscholz

tomscholz Jun 10, 2017

Contributor

@Thanood

[...] Materialize to explicitly require jquery and in turn forcing the app to only have one single jquery instance might solve this issue.

Should be fixed with #4774

Contributor

tomscholz commented Jun 10, 2017

@Thanood

[...] Materialize to explicitly require jquery and in turn forcing the app to only have one single jquery instance might solve this issue.

Should be fixed with #4774

@tomscholz

This comment has been minimized.

Show comment
Hide comment
@tomscholz

tomscholz Jul 20, 2017

Contributor

Error: Cannot find module './picker.js' from '.../whatever/node_modules/materialize-css/bin'

Fixed in ebf3967

Contributor

tomscholz commented Jul 20, 2017

Error: Cannot find module './picker.js' from '.../whatever/node_modules/materialize-css/bin'

Fixed in ebf3967

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.