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

Error log4js is not defined #21

Open
yuanfeibi opened this issue Jul 5, 2020 · 3 comments
Open

Error log4js is not defined #21

yuanfeibi opened this issue Jul 5, 2020 · 3 comments

Comments

@yuanfeibi
Copy link

Hi, I am not sure I use this module correctly.

I installed it by npm then try to create new server in my JS application. But I got "log4js is not defined error". Did I miss something?

To fix it, I manually add var log4js = require('log4js'); to the source code.

@baptistepattyn
Copy link

Indeed add the line of code var log4js = require('log4js') to all of the source files that fixes the issue

@mseashor
Copy link

Not sure if this is the proper way either, but if you set log4js up as a global variable (drop var from var log4js = require('log4js'); to look like: log4js = require('log4js');) you don't need to modify the wstun source.

Example:

log4js = require('log4js')
var wstun = require("@mdslab/wstun");

reverse_server = new wstun.server_reverse();

reverse_server = new wstun.server_reverse({ssl:true, key:"key", cert:"key.pub"});

reverse_server.start(443);

@MohamedLamineAllal
Copy link

Many libraries do that ! Like laravel mix!

global.log4js = require('log4js')

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

4 participants