soda-js icon indicating copy to clipboard operation
soda-js copied to clipboard

Requiring eventemitter2 breaks webpack

Open jasonlally opened this issue 9 years ago • 1 comments

https://github.com/webpack/webpack/issues/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

jasonlally avatar Mar 27 '16 18:03 jasonlally

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

jhtimmins avatar Nov 02 '16 17:11 jhtimmins