question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error finding module using webpack/bower

See original GitHub issue

When trying to import the library I get the following error:

ERROR in ./bower_components/pickadate/lib/picker.date.js
Module not found: Error: Cannot resolve module 'picker' in /Users/jmrubio/react/mobile-react/bower_components/pickadate/lib
 @ ./bower_components/pickadate/lib/picker.date.js 10:8-47

Changing the import in picker.date.js seems to fix this issue for me:

/*!
 * Date picker for pickadate.js v3.5.6
 * 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') )

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

}

change to:

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

(function ( factory ) {

   module.exports = factory( require('./picker.js'), require('jquery') )

}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

26reactions
oquiscommented, May 12, 2016

I solved this by adding an alias in webpack’s config file:

resolve: {
  alias: { 'picker': 'pickadate/lib/picker' }
}

I’m sure there’s a better way of resolving this issue, but I have no idea how to do it right now

3reactions
nonamezcommented, Dec 21, 2018

@oquis @japostigo-atsistemas can give a hint ho to use it after adding that resolve thing… How to import it in file? Just import 'picker' ? Or via require? Tried many things but still get jQuery(...).pickadate is not a function

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Error: Cannot find module 'webpack' - Stack Overflow
Error : Cannot find module 'webpack' is a node error. So this has nothing to do with webpack itself (afaict). It seems like...
Read more >
How to fix Error: cannot find module "webpack" - Educative.io
The Cannot find module webpack occurs when webpack is not globally installed. It is a problem with the npm script or application. You...
Read more >
Cannot find module" when using inline webpack loaders with ...
Trying to use a webpack raw-loader for an HTML file inline resulted in an error: TS2307: Cannot find module. Here's how to fix...
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
What does this error mean in Python? As the name implies, this error occurs when you're trying to access or use a module...
Read more >
Go Modules Reference - The Go Programming Language
If there were no higher versions, the go command reported an error. ... In module-aware mode, the go command uses go.mod files to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found