0no-co / wonka

🎩 A tiny but capable push & pull stream library for TypeScript and Flow
MIT License
709 stars 29 forks source link

Newer versions of node can't use Wonka #97

Closed justgage closed 2 years ago

justgage commented 3 years ago

Some of the newest versions of NPM require the package.json's exports to include wonka.bs.js . Sorry, I'm not providing a lot of detail right now, just wanted to write this down before I forgot.

mrmurphy commented 3 years ago

Specifically, Node version 12.14.1 can use Wonka from ReasonML without any errors, but upgrading to 12.19.0 aborts with an error that "./src/Wonka.bs.js" isn't listed in the package's exports.

I've applied this patch locally to fix for now using patch-package:

diff --git a/node_modules/wonka/package.json b/node_modules/wonka/package.json
index 63c402e..08a5d0d 100644
--- a/node_modules/wonka/package.json
+++ b/node_modules/wonka/package.json
@@ -80,6 +84,7 @@
       "types": "./dist/types/src/Wonka.d.ts",
       "source": "./src/Wonka.ts"
     },
+    "./src/Wonka.bs.js": "./src/Wonka.bs.js",
     "./package.json": "./package.json"
   },
   "files": [