Please help me with my js script - ReferenceError: init is not defined

1375 views javascript

can someone please help me with my script? I almost know nothing about scripting, so please explain me!

When i run the js script with node, it shows me "ReferenceError: init is not defined" at 244.

Here is the script:


answered question

Your question will be much more likely to receive an answer if you can produce a MVCE. (As a side bonus, you'll often find that you can solve the problem yourself when trying to produce this.)

Posting the link like that to get around the filter is going to get you downvotes FYI

@MichaelMior I just tried - there's too much code to add to the question

Please add the relevant code, not a link to the huge file you have in pastebin,

Without looking, I am guessing that init is not defined in the code....

Seriously, you post a pastebin with 2241 lines of Javascript code and hope for someone debugging that for you?

1 Answer


Your problem is you haven't defined init in your code. You might have named it wrong, or you could have simply forgotten to add it in (maybe it's meant to be an SQL query?) You need to create init (based on your code, it's obviously an object). Do so like this:

var init = {
    token: 10,
    steamid: "Init",
    //Whatever else you want to add

posted this

Have an answer?


Please login first before posting an answer.