Error finding module using webpack/bower
See original GitHub issueWhen 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:
- Created 7 years ago
- Reactions:1
- Comments:7
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I solved this by adding an alias in webpack’s config file:
I’m sure there’s a better way of resolving this issue, but I have no idea how to do it right now
@oquis @japostigo-atsistemas can give a hint ho to use it after adding that
resolve
thing… How to import it in file? Justimport 'picker'
? Or viarequire
? Tried many things but still getjQuery(...).pickadate is not a function