Missing eventEmitter with Webpack
See original GitHub issueHey!
I’ve been getting an error while using imagesloaded with webpack while requiring it, and the trouble looks to be in the module definition. The error is:
Module not found: Error: Cannot resolve module 'eventEmitter/EventEmitter' in /Users/opportunato/projects/grabr-web-client/node_modules/imagesloaded
And the related code is:
if ( typeof define === 'function' && define.amd ) {
// AMD
define( [
'EventEmitter/EventEmitter',
'eventie/eventie'
], function( EventEmitter, eventie ) {
return factory( window, EventEmitter, eventie );
});
}
There is no folder “EventEmitter” in my node_modules/imagesloaded folder, just “wolfy87-eventemitter”.
So, if I change EventEmitter/EventEmitter
to ‘wolfy87-eventemitter/EventEmitter’ (as defined in package.json), everything works smoothly. Am I missing something here or is there a need in PR?
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Can't understand what's going on with EventEmitter using ...
I'm trying to learn webpack and es6 at the same time and realized a need for some sort of event bus. I'm new...
Read more >webpack/webpack - Gitter
I use the Node.js EventEmitter. resolve:{ modulesDirectories: ['node_modules'], alias:{ "events": "{module}" } } Is this how it's normally done?
Read more >wzx-event-emitter - npm Package Health Analysis - Snyk
Is wzx-event-emitter safe to use? The npm package wzx-event-emitter was scanned for known vulnerabilities and missing license, and no issues ...
Read more >Events | NestJS - A progressive Node.js framework
npm i --save @nestjs/event-emitter ... disable throwing uncaughtException if an error event is emitted and it has no listeners ignoreErrors: false, }); ...
Read more >eventemitter3 - npm
This means you no longer have the overhead of an event that required fn.bind in order to get a custom this value. var...
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 FreeTop 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
Top GitHub Comments
@afader Yes, i got it working by simply adding this configuration to webpack:
@mannebusk your solution also helps with Flickity, thanks!