cayasso / mongo-oplog

Watch mongodb oplog in a simple way
381 stars 91 forks source link

Error: only one instance of babel-polyfill is allowed #47

Closed AndreSteenveld closed 6 years ago

AndreSteenveld commented 7 years ago

I have a project where I use mongo-oplog as a dependency, during the startup of the application babel-polyfill is imported. When importing monog-oplog the error "only one instance of babel-polyfill is allowed" is thrown from babel-polyfill.

I've encountered a similar issue before and the found that replacing import 'babel-polyfill' with global._babelPolyfill || require( "babel-polyfill" ); sort of works around the problem but doesn't really solve it because the assumption is made that every library will make sure to check their babel-polyfill import.

aslafy-z commented 7 years ago

I made a fork (aestetype/mongo-oplog) who includes @AndreSteenveld's patch. It's published on npm through @aestetype/mongo-oplog.

cayasso commented 6 years ago

This commit https://github.com/cayasso/mongo-oplog/commit/fc2a1ec671b3cfd07f08009ccc10eb3b7e35841d should address this issue.

aslafy-z commented 6 years ago

@cayasso Could you please npm deploy the fix ?

cayasso commented 6 years ago

I was doing it while you were writing ;-) 2.1.0 is out now