-
Notifications
You must be signed in to change notification settings - Fork 57
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
Import { init } from 'buttercup' fails "expected to be CommonJS" #286
Comments
Maybe related: nodejs/node#32137 |
@cullub Ah, you're using node's new You should try to do as the error suggests: import buttercup from 'buttercup';
const { Credentials, FileDatasource, Vault, init } = buttercup; Note that Node's documentation on the
As the default is commonjs, I feel that there's no change needed. We don't export ES modules (only for the web). CommonJS is supported on all node versions whereas ES modules are not. We also don't plan to support a third build mode just for ES6+ import support, sorry. I'll close this issue for now, but if overwhelming evidence to the contrary pops up, I'd happy reconsider my position on this. I think in the end we just want what's:
|
Hey! It is 2 years later now. Due to the broad support of ES modules in Node in 2022, would you have any interest in forming a combined effort to update this project to support them. I would love to be part of this and would be happy to contribute! :) Lmk! |
Hey, I'm not 100% sure but it still seems like ESM is not supported in Electron: electron/electron#21457 I'd be happy to be corrected here of course. But until they are supported I don't think changing Buttercup core to ESM is wise nor needed. |
I'm getting the following error:
However, that line is taken directly from the buttercup-core README.md. Maybe your package.json is missing a
type: module
?The text was updated successfully, but these errors were encountered: