rollup-plugin-polyfill-node icon indicating copy to clipboard operation
rollup-plugin-polyfill-node copied to clipboard

EventEmitter polyfill export disallows extension

Open dmotz opened this issue 3 years ago • 2 comments

When I run snowpack dev --polyfill-node, I get an error for a class extending the events polyfill:

TypeError: Class extends value [object Object] is not a constructor or null

Snowpack is outputting this:

class Foo extends polyfillNode_events {

But polyfillNode_events is not a function and looks like this:

{
  EventEmitter: ƒ EventEmitter()
  default: ƒ EventEmitter()
}

I'm not sure if Snowpack should be handling this by outputting polyfillNode_events.default or the exports in this package should be changed.

dmotz avatar Feb 15 '21 20:02 dmotz