selfrefactor/rambda

v7.0.1 import fails w/ Node.js v17.3.0

bompus opened this issue ยท 7 comments

I'm using pnpm 6.25.0-2 with Node.js v17.3.0

package.json has "type": "module" specified for Node.js ESM support.

file:///path/to/feature.type.js:1
import { filter, indexBy, map, omit, path, pick } from 'rambda';
         ^^^^^^
SyntaxError: Named export 'filter' not found. The requested module 'rambda' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'rambda';
const { filter, indexBy, map, omit, path, pick } = pkg;

Thanks for the report. Can you share if you know utility library(or any other package), that has a working ESM setup?

A fix is applied. I will write again when a release is made.

cjk commented

Thanks! Rambdax is also affected by this, but you probably know this already ๐Ÿ˜„

Yes, I know about it @cjk and thanks for reminding me of the issue. Initially, I intended to release the fix with 7.1.0 version, but it will take time to be fully ready. So, I'll make a patch release for Rambda/Rambdax as it is important issue and I shouldn't hold the fix if it is ready.

Closing it as I just released Rambda 7.0.2 and Rambdax 8.0.1 with a fix. Let me know if it works for you.

Working now. Thank you!