<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto"><a href="https://gist.github.com/caseyWebb/a5fdd929638f961ee673581e7d68ddb1">https://gist.github.com/caseyWebb/a5fdd929638f961ee673581e7d68ddb1</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">No error should be thrown</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong></p>
<ul dir="auto">
<li>Firefox 58 &amp; Chrome 64</li>
<li>Node 9.5.0</li>
<li>webpack 3.10.0 &amp; webpack@next</li>
<li>webpack-dev-server 2.11.1 &amp; webpack-dev-server@next</li>
<li>MacOS 10.13</li>
</ul>
<p dir="auto">When the <code class="notranslate">NamedModulesPlugin</code> is added, a different error is thrown, and the generated code is</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="webpackHotUpdate(0,{

/***/ &quot;./src/index.js&quot;:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

&quot;use strict&quot;;
Object.defineProperty(__webpack_exports__, &quot;__esModule&quot;, { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__log_js__ = __webpack_require__(&quot;./src/log.js&quot;);


Object(__WEBPACK_IMPORTED_MODULE_0__log_js__[&quot;log&quot;])()

/**
 * THIS IS THE IMPORTANT/BROKEN PART
 */
module.hot.accept(&quot;./src/log.js&quot;&quot;./src/log.js&quot;, function(__WEBPACK_OUTDATED_DEPENDENCIES__) { /* harmony import */ __WEBPACK_IMPORTED_MODULE_0__log_js__ = __webpack_require__(&quot;./src/log.js&quot;); (function(__WEBPACK_OUTDATED_DEPENDENCIES__) { /* harmony import */ __WEBPACK_IMPORTED_MODULE_0__log_js__ = __webpack_require__(&quot;./src/log.js&quot;); (() =&gt; Object(__WEBPACK_IMPORTED_MODULE_0__log_js__[&quot;log&quot;])())(__WEBPACK_OUTDATED_DEPENDENCIES__); })(__WEBPACK_OUTDATED_DEPENDENCIES__); })

/***/ }),

/***/ &quot;./src/log.js&quot;:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

&quot;use strict&quot;;
Object.defineProperty(__webpack_exports__, &quot;__esModule&quot;, { value: true });
/* harmony export (immutable) */ __webpack_exports__[&quot;log&quot;] = log;
function log() {
  document.body.innerText += 'foo\n'
  document.body.innerText += 'bar\n'
}

/***/ })
})"><pre class="notranslate"><code class="notranslate">webpackHotUpdate(0,{

/***/ "./src/index.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__log_js__ = __webpack_require__("./src/log.js");


Object(__WEBPACK_IMPORTED_MODULE_0__log_js__["log"])()

/**
 * THIS IS THE IMPORTANT/BROKEN PART
 */
module.hot.accept("./src/log.js""./src/log.js", function(__WEBPACK_OUTDATED_DEPENDENCIES__) { /* harmony import */ __WEBPACK_IMPORTED_MODULE_0__log_js__ = __webpack_require__("./src/log.js"); (function(__WEBPACK_OUTDATED_DEPENDENCIES__) { /* harmony import */ __WEBPACK_IMPORTED_MODULE_0__log_js__ = __webpack_require__("./src/log.js"); (() =&gt; Object(__WEBPACK_IMPORTED_MODULE_0__log_js__["log"])())(__WEBPACK_OUTDATED_DEPENDENCIES__); })(__WEBPACK_OUTDATED_DEPENDENCIES__); })

/***/ }),

/***/ "./src/log.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["log"] = log;
function log() {
  document.body.innerText += 'foo\n'
  document.body.innerText += 'bar\n'
}

/***/ })
})
</code></pre></div>
<p dir="auto">This leads me to believe that for some reason the module identifier is being duplicated. I think the octal error is an effect of <code class="notranslate">0</code> being doubled to <code class="notranslate">00</code>.</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
A Bug</p>


<p dir="auto"><strong>What is the current behavior?</strong><br>
Our application has ~2K modules with multiple entries. After compiling these entry points, webpack logs given entries + distorted entries in output and emits duplicate events like <code class="notranslate">after-compile</code>. With this, our custom plugins are executed twice or thrice for each entry point and causing unexpected issues.</p>
<p dir="auto">Here is one such output from webpack</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Hash: b09d9f200c42ca4a76dbf8cc66d5e8b587fba22bdd218de191690012cb805ea514138c6d9e3071acbee62c6b402563b345eeeb7ce7ec3db9b3fcb1aeaf11a86131ea1f00ab71
Version: webpack 3.6.0 / grunt-webpack 3.0.2
Child
    Hash: b09d9f200c42ca4a76db
    Time: 98314ms
                             Asset     Size  Chunks                    Chunk Names
                foo_app.bundle.js  14.7 MB       0  [emitted]  [big]  foo_app
         foo_app_vendor.bundle.js  5.81 MB       1  [emitted]  [big]  vendor
Child
    Hash: f8cc66d5e8b587fba22b
    Time: 101489ms
                                  Asset     Size  Chunks                    Chunk Names
                    bar_app.bundle.js  10.6 MB       0  [emitted]  [big]  bar_app
         bar_app_vendor.bundle.js  9.81 MB       1  [emitted]  [big]  vendor

## Following are distorted chunks which are not in config ##
Child
    Hash: dd218de191690012cb80
    Time: 19155ms
     4 assets
Child
    Hash: 5ea514138c6d9e3071ac
    Time: 11085ms
     3 assets
Child
    Hash: bee62c6b402563b345ee
    Time: 10084ms
     3 assets
Child
    Hash: eb7ce7ec3db9b3fcb1ae
    Time: 1359ms
     2 assets
Child
    Hash: af11a86131ea1f00ab71
    Time: 13631ms
     4 assets"><pre class="notranslate"><code class="notranslate">Hash: b09d9f200c42ca4a76dbf8cc66d5e8b587fba22bdd218de191690012cb805ea514138c6d9e3071acbee62c6b402563b345eeeb7ce7ec3db9b3fcb1aeaf11a86131ea1f00ab71
Version: webpack 3.6.0 / grunt-webpack 3.0.2
Child
    Hash: b09d9f200c42ca4a76db
    Time: 98314ms
                             Asset     Size  Chunks                    Chunk Names
                foo_app.bundle.js  14.7 MB       0  [emitted]  [big]  foo_app
         foo_app_vendor.bundle.js  5.81 MB       1  [emitted]  [big]  vendor
Child
    Hash: f8cc66d5e8b587fba22b
    Time: 101489ms
                                  Asset     Size  Chunks                    Chunk Names
                    bar_app.bundle.js  10.6 MB       0  [emitted]  [big]  bar_app
         bar_app_vendor.bundle.js  9.81 MB       1  [emitted]  [big]  vendor

## Following are distorted chunks which are not in config ##
Child
    Hash: dd218de191690012cb80
    Time: 19155ms
     4 assets
Child
    Hash: 5ea514138c6d9e3071ac
    Time: 11085ms
     3 assets
Child
    Hash: bee62c6b402563b345ee
    Time: 10084ms
     3 assets
Child
    Hash: eb7ce7ec3db9b3fcb1ae
    Time: 1359ms
     2 assets
Child
    Hash: af11a86131ea1f00ab71
    Time: 13631ms
     4 assets
</code></pre></div>
<p dir="auto">On debugger mode, obj in <a href="https://github.com/webpack/webpack/blob/7fe03718f2e5eb554ec3e76eb0536fe2aa56c2a8/lib/Stats.js#L600">lib/Stats.js</a> file has following value:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ errors: [],
  warnings: [],
  hash: 'af11a86131ea1f00ab71',
  time: 13631,
  assetsByChunkName:
   { bar_app: 'bar_app.bundle.js',
     vendor: 'bar_app_vendor.bundle.js' },
  assets: [],
  filteredAssets: 4,
  children: [],
  name: undefined } // wonder why name is undefined here."><pre class="notranslate"><span class="pl-kos">{</span> <span class="pl-c1">errors</span>: <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c1">warnings</span>: <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c1">hash</span>: <span class="pl-s">'af11a86131ea1f00ab71'</span><span class="pl-kos">,</span>
  <span class="pl-c1">time</span>: <span class="pl-c1">13631</span><span class="pl-kos">,</span>
  <span class="pl-c1">assetsByChunkName</span>:
   <span class="pl-kos">{</span> <span class="pl-c1">bar_app</span>: <span class="pl-s">'bar_app.bundle.js'</span><span class="pl-kos">,</span>
     <span class="pl-c1">vendor</span>: <span class="pl-s">'bar_app_vendor.bundle.js'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c1">assets</span>: <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c1">filteredAssets</span>: <span class="pl-c1">4</span><span class="pl-kos">,</span>
  <span class="pl-c1">children</span>: <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c1">name</span>: <span class="pl-c1">undefined</span> <span class="pl-kos">}</span> <span class="pl-c">// wonder why name is undefined here.</span></pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Sample webpack config: <a href="https://gist.github.com/muralikr/57a9667b6570027d171579447f7dfa6e">https://gist.github.com/muralikr/57a9667b6570027d171579447f7dfa6e</a><br>
We are using custom loader and plugin in our config. Both of them does only synchronous tasks (like modifying source of few modules, processing and storing as files).</p>



<p dir="auto"><strong>What is the expected behavior?</strong><br>
Webpack should emit plugin related events only once per entry. If it gets into any error state, it should throw error and suspend compiling.</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br>
node -- v6.10.0<br>
webpack -- 3.5.6<br>
Mac OSX Sierra</p>