Skip to content
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

Requiring eventemitter2 breaks webpack #18

Open
jasonlally opened this issue Mar 27, 2016 · 1 comment
Open

Requiring eventemitter2 breaks webpack #18

jasonlally opened this issue Mar 27, 2016 · 1 comment

Comments

@jasonlally
Copy link

webpack/webpack#43

Based on the above issue, I think the fix, when requiring eventemitter2 is to:

var ee2Lib = require('eventemitter2'), EventEmitter = ee2Lib.EventEmitter2 || ee2Lib

Appears the library has 2 interfaces, one for AMD and one for CommonJS

I was able to test this locally and it worked. I no longer got the error:

Uncaught TypeError: EventEmitter is not a constructor

@jhtimmins
Copy link

This worked for me. @jasonlally has a PR been opened for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants