Closed acrazing closed 4 years ago
same issue -
using babel _interopRequireWildcard instead works
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc =
Object.defineProperty && Object.getOwnPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key)
: {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
This function is declared at https://github.com/Microsoft/tslib/blob/master/tslib.js#L212-L217 .
Why not use __importDefault at https://github.com/Microsoft/tslib/blob/master/tslib.js#L220-L222 ?
This bug could be reproduce by eval
import("raven-js")
, because its exports is an is an object with custom prototype.