-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
publish dual packages (ESM + CommonJS) #69
Comments
Is it possible to use rmrk-tools with node? When I try to use it with imports/exports module I get the following error: $ node script.js
file:///Users/bruno/src/examples/node-dot/getRemarks.js:1
import { fetchRemarks, getRemarksFromBlocks, getLatestFinalizedBlock, Consolidator } from 'rmrk-tools';
^^^^^^^^^^^^
SyntaxError: Named export 'Consolidator' not found. The requested module 'rmrk-tools' 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 'rmrk-tools';
const { fetchRemarks, getRemarksFromBlocks, getLatestFinalizedBlock, Consolidator } = pkg; |
yes. rmrk has yet to solve this issue. I just end up adding |
It would be nice if "type": "module" could be added to the package json. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is it possible to to publish dual packages (ESM + CommonJS), using conditional exports?
The text was updated successfully, but these errors were encountered: