Skip to content

TypeError in CommonJS export hack: Object.assign called with undefined default export in @jsdevtools/ono #22

@kajaldalai

Description

@kajaldalai

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @jsdevtools/[email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@jsdevtools/ono/esm/index.js b/node_modules/@jsdevtools/ono/esm/index.js
index 7e6b469..c0cebe6 100644
--- a/node_modules/@jsdevtools/ono/esm/index.js
+++ b/node_modules/@jsdevtools/ono/esm/index.js
@@ -6,6 +6,6 @@ export { ono };
 export default ono;
 // CommonJS default export hack
 if (typeof module === "object" && typeof module.exports === "object") {
-    module.exports = Object.assign(module.exports.default, module.exports);
+    module.exports = Object.assign(module.exports.default || {}, module.exports);
 }
 //# sourceMappingURL=index.js.map

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions