Closed black7375 closed 3 months ago
Hi I found some problems when I publish Debug-log
package,
yarn install
& yarn build
proceeding was sccessfully finished, But after proceeding to yarn workspace @mincho-js/debug-log run publish
, I got the following error
So I changed project name mincho
to mincho-js
"pretify-deep-diff"
When we proceed yarn add @mincho-js/debug-log
, we have to choose version of "pretify-deep-diff"
require()
when I test const debugLogs = require("@mincho-js/debug-log")
on node terminal
Uncaught:
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\project_test\node_modules\chalk\source\index.js from D:\project_test\node_modules\@mincho-js\debug-log\dist\cjs\index.cjs not supported.
Instead change the require of index.js in D:\project_test\node_modules\@mincho-js\debug-log\dist\cjs\index.cjs to a dynamic import() which is available in all CommonJS modules.
at Module.<anonymous> (D:\project_test\node_modules\@mincho-js\debug-log\dist\cjs\index.cjs:1:89) {
code: 'ERR_REQUIRE_ESM'
}
I got a warning message about importing JSON modules
(node:30428) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
It could find when we use debug-log tools
Yes. It seems to be fully resolved once it is reflected in the lockfile.
"pretify-deep-diff"
This is because we are using a patched version. Let's solve this by forking the project and deploying our patched version.
require()
This rough prototype works well. (chalk
, boxen
convert to dynamic load)
But, You should have switched all your code to asynchronous. The tool was intended for internal use, so it's not worth the extra effort here.
IMO, We recommend using it as a dedicated ESM.
See
Now published. We only support ESM package.
Description
Package and release the internal tool
debug-log
.