rollup-plugin-polyfill-node
rollup-plugin-polyfill-node copied to clipboard
EventEmitter polyfill export disallows extension
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.
Is somebody working on this? @dmotz Do you have a workaround for the issue?
@adgang Unfortunately no. I ended up switching to a different library that didn't need EventEmitter
to avoid having to change my bundler setup.