title: Is this webpack warning safe to ignore?
body: <p>I found a strange warning in webpack. While parsing <code>process.env</code> using <code>babel-loader</code>. A warning(<code>TypeError: result.setExpression is not a function</code>) occurred in<code>webpack/lib/Parser.js</code>. I'm on a big project and want my core to be super solid. So is it safe to ignore this warning, since webpack explicitly catches it and comments 'ignore error'?</p>
  
  <p>The warning(<code>TypeError: result.setExpression is not a function</code>) occurred here(webpack/lib/Parser.js <a href="https://github.com/webpack/webpack/blob/2361995a429794d372d61e3fb628dea3929e0ca4/lib/Parser.js#L1987" rel="noreferrer">https://github.com/webpack/webpack/blob/2361995a429794d372d61e3fb628dea3929e0ca4/lib/Parser.js#L1987</a>)</p>
  
  <pre><code>evaluateExpression(expression) {
      try {
          const hook = this.hooks.evaluate.get(expression.type);
          if (hook !== undefined) {
              const result = hook.call(expression);
              if (result !== undefined) {
                  if (result) {
                      result.setExpression(expression);
                  }
                  return result;
              }
          }
      } catch (e) {
          console.warn(e);
          // ignore error
      }
      return new BasicEvaluatedExpression()
          .setRange(expression.range)
          .setExpression(expression);
  }
  </code></pre>
  
  <p>I printed this <code>result</code>, and found it to be </p>
  
  <pre><code>BasicEvaluatedExpression {
    type: 0,
    range: [ 945, 956 ],
    falsy: false,
    truthy: true,
    bool: null,
    number: null,
    regExp: null,
    string: null,
    quasis: null,
    array: null,
    items: null,
    options: null,
    prefix: null,
    postfix: null } 
  </code></pre>
  
  <p>I also printed the <code>expression</code></p>
  
  <pre><code>{
    type: 'MemberExpression',
    start: 945,
    end: 956,
    loc: 
     SourceLocation {
       start: Position { line: 16, column: 13 },
       end: Position { line: 16, column: 24 } },
    range: [ 945, 956 ],
    object: 
     Node {
       type: 'Identifier',
       start: 945,
       end: 952,
       loc: SourceLocation { start: [Object], end: [Object] },
       range: [ 945, 952 ],
       name: 'process' },
    property: 
     Node {
       type: 'Identifier',
       start: 953,
       end: 956,
       loc: SourceLocation { start: [Object], end: [Object] },
       range: [ 953, 956 ],
       name: 'env' },
    computed: false }
  </code></pre>
  
  <p>The <code>process.env</code> came from something like <code>
  var isProd = process.env &amp;&amp; process.env.NODE_ENV === 'production';</code></p>
  
  <p><strong>Background:</strong> </p>
  
  <p>The complete warning message: </p>
  
  <pre><code>TypeError: result.setExpression is not a function
      at Parser.evaluateExpression (node_modules/webpack/lib/Parser.js:1991:14)
      at hooks.evaluate.for.tap.expr (node_modules/webpack/lib/Parser.js:368:17)
      at SyncBailHook.eval [as call] (eval at create (node_modules/tapable/lib/HookCodeFactory.js:19:10), &lt;anonymous&gt;:7:16)
      at Parser.evaluateExpression (node_modules/webpack/lib/Parser.js:1984:25)
      at parser.hooks.statementIf.tap.statement (node_modules/webpack/lib/ConstPlugin.js:122:28)
      at SyncBailHook.eval [as call] (eval at create (node_modules/tapable/lib/HookCodeFactory.js:19:10), &lt;anonymous&gt;:7:16)
      at Parser.walkIfStatement (node_modules/webpack/lib/Parser.js:1011:41)
      at Parser.walkStatement (node_modules/webpack/lib/Parser.js:961:10)
      at Parser.walkStatements (node_modules/webpack/lib/Parser.js:864:9)
      at Parser.walkBlockStatement (node_modules/webpack/lib/Parser.js:996:8)
      at Parser.walkStatement (node_modules/webpack/lib/Parser.js:931:10)
      at inScope (node_modules/webpack/lib/Parser.js:1603:10)
      at Parser.inScope (node_modules/webpack/lib/Parser.js:1910:3)
      at Parser.walkFunctionExpression (node_modules/webpack/lib/Parser.js:1596:8)
      at Parser.walkExpression (node_modules/webpack/lib/Parser.js:1509:10)
      at Parser.walkAssignmentExpression (node_modules/webpack/lib/Parser.js:1694:8)
      at Parser.walkExpression (node_modules/webpack/lib/Parser.js:1491:10)
      at Parser.walkExpressionStatement (node_modules/webpack/lib/Parser.js:1000:8)
      at Parser.walkStatement (node_modules/webpack/lib/Parser.js:946:10)
      at Parser.walkStatements (node_modules/webpack/lib/Parser.js:864:9)
      at Parser.walkBlockStatement (node_modules/webpack/lib/Parser.js:996:8)
      at Parser.walkStatement (node_modules/webpack/lib/Parser.js:931:10)
      at inScope (node_modules/webpack/lib/Parser.js:1792:10)
      at Parser.inScope (node_modules/webpack/lib/Parser.js:1910:3)
      at Parser._walkIIFE (node_modules/webpack/lib/Parser.js:1780:8)
      at Parser.walkCallExpression (node_modules/webpack/lib/Parser.js:1817:9)
      at Parser.walkExpression (node_modules/webpack/lib/Parser.js:1500:10)
      at Parser.walkVariableDeclaration (node_modules/webpack/lib/Parser.js:1381:32)
      at Parser.walkStatement (node_modules/webpack/lib/Parser.js:979:10)
      at Parser.walkStatements (node_modules/webpack/lib/Parser.js:864:9)
      at Parser.parse (node_modules/webpack/lib/Parser.js:2127:9)
      at doBuild.err (node_modules/webpack/lib/NormalModule.js:446:32)
      at runLoaders (node_modules/webpack/lib/NormalModule.js:327:12)
      at node_modules/loader-runner/lib/LoaderRunner.js:370:3
      at iterateNormalLoaders (node_modules/loader-runner/lib/LoaderRunner.js:211:10)
      at iterateNormalLoaders (node_modules/loader-runner/lib/LoaderRunner.js:218:10)
  </code></pre>
  
  <p>My babel configs are:</p>
  
  <pre><code>"webpack": "4.25.1",
  "babel-core": "6.26.3",
  "babel-eslint": "8.2.6",
  "babel-loader": "7.1.5",
  "babel-plugin-transform-class-properties": "6.24.1",
  "babel-plugin-transform-object-rest-spread": "6.26.0",
  "babel-plugin-transform-runtime": "6.23.0",
  "babel-preset-env": "1.7.0",
  "babel-preset-react": "6.24.1",
  "babel-register": "6.26.0",
  
  
  const babelCoreConfig = {
      babelrc: false,
      presets: [
         'babel-preset-env',
         'babel-preset-react'
      ],
      plugins: [
         'babel-plugin-transform-class-properties',
          ['babel-plugin-transform-runtime', {
              helpers: true,
              polyfill: false,
              regenerator: false,
          }],
         'babel-plugin-transform-object-rest-spread'
      ]
  };
  </code></pre>