You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrading Chalk to the next major version (v5) results in the following ES module error during runtime.
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/olian04/Documents/Projects/better-logging/node_modules/chalk/source/index.js from /home/olian04/Documents/Projects/better-logging/dist/themes/dark.js not supported.
Instead change the require of index.js in /home/olian04/Documents/Projects/better-logging/dist/themes/dark.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/olian04/Documents/Projects/better-logging/dist/themes/dark.js:7:33)
at Object.<anonymous> (/home/olian04/Documents/Projects/better-logging/dist/lib/config.js:6:16)
at Object.<anonymous> (/home/olian04/Documents/Projects/better-logging/dist/lib/logger.js:5:18)
at Object.<anonymous> (/home/olian04/Documents/Projects/better-logging/dist/api.js:27:18)
at Object.<anonymous> (/home/olian04/Documents/Projects/better-logging/test/integration-tests/custom-formatting.test.js:3:28)
at async Promise.all (index 0)
at async formattedImport (/home/olian04/Documents/Projects/better-logging/node_modules/mocha/lib/nodejs/esm-utils.js:7:14)
at async Object.exports.requireOrImport (/home/olian04/Documents/Projects/better-logging/node_modules/mocha/lib/nodejs/esm-utils.js:48:32)
at async Object.exports.loadFilesAsync (/home/olian04/Documents/Projects/better-logging/node_modules/mocha/lib/nodejs/esm-utils.js:103:20)
at async singleRun (/home/olian04/Documents/Projects/better-logging/node_modules/mocha/lib/cli/run-helpers.js:125:3)
at async Object.exports.handler (/home/olian04/Documents/Projects/better-logging/node_modules/mocha/lib/cli/run.js:374:5)
The text was updated successfully, but these errors were encountered:
Olian04
changed the title
Upgrading to Chalk 5.0.0 results in an ESM related runtime error
[Bug Report] Upgrading to Chalk 5.0.0 results in an ESM related runtime error
Mar 22, 2022
Hey, I just found your package and really like it!
My shot at this would be to use https://github.com/doowb/ansi-colors instead of chalk and see if it fits. Since this is a drop-in replacement, effort should be pretty low.
Hi @smonist!
Originally I wanted better-logging to be dependency free. However due to the growth of the library I started to shift my priorities away from "size" and more towards "maintainability". Because of this it seemed like a good idea to move as much logic out of the library as possible. My reasoning for picking Chalk over the alternatives was simply based on its popularity.
I'll need to take a deeper look into doowb/ansi-colors before I can make a real decision, but unless it grows in popularity dramatically or chalk drops in popularity dramatically, I'm likely to stick with chalk for the time being 😃
Upgrading Chalk to the next major version (v5) results in the following ES module error during runtime.
The text was updated successfully, but these errors were encountered: