Skip to content

cjs compatibility #263

@auth12

Description

@auth12

Hi,

Using the library in a CJS module results in ERR_PACKAGE_PATH_NOT_EXPORTED due to the export definitions of the package?, the following diff fixes the issue.

diff --git a/node_modules/@massive.com/client-js/package.json b/node_modules/@massive.com/client-js/package.json
index 10bd9dd..de06876 100644
--- a/node_modules/@massive.com/client-js/package.json
+++ b/node_modules/@massive.com/client-js/package.json
@@ -6,8 +6,11 @@
   "types": "dist/main.d.ts",
   "type": "module",
   "exports": {
-    "types": "./dist/main.d.ts",
-    "import": "./dist/main.js"
+    ".": {
+      "types": "./dist/main.d.ts",
+      "default": "./dist/main.js",
+      "import": "./dist/main.js"
+    }
   },
   "scripts": {
     "test": "mocha",

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