Skip to content
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

Problem after installing plugin - incompatibility with ES Module #70

Open
sebasanta opened this issue Aug 29, 2024 · 0 comments
Open

Problem after installing plugin - incompatibility with ES Module #70

sebasanta opened this issue Aug 29, 2024 · 0 comments

Comments

@sebasanta
Copy link

After installing the plugin, when I try to start Haraka I get this error:
[INFO] [-] [plugins] loading accounting-files
[CRIT] [-] [plugins] compiling 'accounting-files' failed
[CRIT] [-] [core] node_modules/haraka-plugin-accounting-files/index.js:8
[CRIT] [-] [core] var dateFormat = require('dateformat');\r
[CRIT] [-] [core] ^
[CRIT] [-] [core]
[CRIT] [-] [core] Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/dateformat/lib/dateformat.js from node_modules/haraka-plugin-accounting-files/index.js not supported.
[CRIT] [-] [core] Instead change the require of dateformat.js in node_modules/haraka-plugin-accounting-files/index.js to a dynamic import() which is available in all CommonJS modules.
[CRIT] [-] [core] at Object. (node_modules/haraka-plugin-accounting-files/index.js:8:19)

I fixed it installing the last version of dateformat that supports CommonJS require, 4.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant