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.

Missing eventEmitter with Webpack

See original GitHub issue

Hey!

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:closed
  • Created 8 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mannebuskcommented, Oct 22, 2015

@afader Yes, i got it working by simply adding this configuration to webpack:

resolve: {
  alias: {
    "eventEmitter/EventEmitter": "wolfy87-eventemitter"
  }
},
0reactions
michalmikolajczykcommented, Feb 12, 2016

@mannebusk your solution also helps with Flickity, thanks!

Read more comments on GitHub >

github_iconTop 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 >

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