Reference Error: DEBUG is not defined.
Currently I am using html2json npm package but it is giving me the error DEBUG is not defined. I am using it for converting html code to json in an angular project.


Kindly help me out with this issue.
I am facing the same issue, If you found the fix can you please share it.
Same issue here, anyone found a fix?
Also got that issue. No idea why suddenly. Can't use this package anymore.
I got the same problem, at first I decided to patch it with yarn patch, because I think the DEBUG var was not correctly hoisted, for some reason. Maybe the new ES versions treat this differently...last commit on this package was 7 years ago.
So, a very dumb patch (also why I didn't consider submitting a PR lol) :
// DEBUG = false;
// var debug = DEBUG ? console.log.bind(console) : function(){};
const debug = function () {};
But then I faced another problem, this time coming from the integrated HTML parser library (in the lib directory). After a few research, it looks like this library is also quite "old" (2008-2010 probably). Error also comes from something which probably didn't behave that way back in the time.
So in the end, I just decided to migrate to another library : https://www.npmjs.com/package/html-to-json-parser Objects format is different, but migration was pretty easy. Also beware the API is async.