I forked a repo of an application that is packaged with webpack. I made a few changes to the index.js and now when I build using webpack, one of my variables in the webpack has a _
in front of it in the declaration, but anytime my code calls that variable it does not have a _
in front of it, thus throwing an error at runtime.
Here is the original from my index.js:
let log_stream_name = ctx.data.LOG_STREAM || ctx.data.AUTH0_DOMAIN;
Here is the result in my bundle.js:
var _log_stream_name = ctx.data.LOG_STREAM || ctx.data.AUTH0_DOMAIN;
Here is a snippet where this variable is used in my bundle.js:
lawger.log(log_stream_name, body.message);
It appears as though this _
is added during the transpiling process from ES6 to ES5 that Babel is doing during the webpack. Any idea why it is doing this? This is also the only variable it is doing it to. There are other similar let
statements in the same code block in my index.js that are net getting the _
prefix.