massive-com / massive-com/client-js
cjs compatibility
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 273
- Forks
- 74
- Avg merge
- 7h 58m
- Merged PRs (30d)
- 11
Description
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",
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the package.json exports map; the issue identifies the package entry points and the CJS failure as ERR_PACKAGE_PATH_NOT_EXPORTED. Verify the change with the repository's npm test script and confirm that a CommonJS consumer can load the package without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100