denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.69k stars 5.38k forks source link

npm:log4js don't work #24858

Closed wangfeng1994 closed 2 months ago

wangfeng1994 commented 3 months ago

Version: Deno 1.45.5 app.mjs

import log4js from "log4js";

const logger = log4js.getLogger();
logger.level = "info";
logger.debug("Got cheese.");
logger.info("Cheese is Comté.");
logger.warn("Cheese is quite smelly.");
logger.error("Cheese is too ripe!");
logger.fatal("Cheese was breeding ground for listeria.");

output image

birkskyum commented 2 months ago

This breaks Karma Runner too. In new project:

➜ pnpm i karma karma-jasmine karma-chrome-launcher jasmine-core
➜ DENO_FUTURE=1 deno ./node_modules/karma/bin/karma start
✅ Granted all env access.
✅ Granted all read access.
✅ Granted all net access.
error: Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at Object.send (file:///Users/admin/repos/deno-kitchensink/karma-test/node_modules/.pnpm/log4js@6.9.1/node_modules/log4js/lib/clustering.js:95:36)
    at Logger._log (file:///Users/admin/repos/deno-kitchensink/karma-test/node_modules/.pnpm/log4js@6.9.1/node_modules/log4js/lib/logger.js:195:16)
    at Logger.log (file:///Users/admin/repos/deno-kitchensink/karma-test/node_modules/.pnpm/log4js@6.9.1/node_modules/log4js/lib/logger.js:155:12)
    at Logger.<computed> [as error] (file:///Users/admin/repos/deno-kitchensink/karma-test/node_modules/.pnpm/log4js@6.9.1/node_modules/log4js/lib/logger.js:235:10)
    at Process.<anonymous> (file:///Users/admin/repos/deno-kitchensink/karma-test/node_modules/.pnpm/karma@6.4.4/node_modules/karma/lib/server.js:400:16)
    at Process.emit (ext:deno_node/_events.mjs:387:28)
    at Process.emit (node:process:390:40)
    at Object.internals.nodeProcessUnhandledRejectionCallback (node:process:610:15)
    at processUnhandledPromiseRejection (ext:runtime_main/js/99_main.js:495:15)
    at eventLoopTick (ext:core/01_core.js:224:25)

➜ node ./node_modules/karma/bin/karma start                     
21 08 2024 21:22:43.102:WARN [karma]: No captured browser, open http://localhost:9876/
21 08 2024 21:22:43.274:INFO [karma-server]: Karma v6.4.4 server started at http://localhost:9876/