<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Webpack build fails with <code class="notranslate">RuntimeTemplate.moduleId() ... has no id. This should not happen</code> error.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Checkout master branch<br>
<a href="https://github.com/kompot/treat-no-module-id-2">https://github.com/kompot/treat-no-module-id-2</a><br>
it's basically a barebones React app but using <a href="https://github.com/seek-oss/treat">treat</a> for styling.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="yarn install
yarn run build"><pre class="notranslate"><code class="notranslate">yarn install
yarn run build
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in chunk 1
1.output.bundle.js
/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.jsx
RuntimeTemplate.moduleId(): Module /Users/kompot/projects/treat-no-module-id-2/node_modules/treat/webpack-plugin/loader.js??ref--4-0!/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.treat.js has no id. This should not happen.

ERROR in chunk 2
2.output.bundle.js
/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.jsx
RuntimeTemplate.moduleId(): Module /Users/kompot/projects/treat-no-module-id-2/node_modules/treat/webpack-plugin/loader.js??ref--4-0!/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.treat.js has no id. This should not happen."><pre class="notranslate"><code class="notranslate">ERROR in chunk 1
1.output.bundle.js
/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.jsx
RuntimeTemplate.moduleId(): Module /Users/kompot/projects/treat-no-module-id-2/node_modules/treat/webpack-plugin/loader.js??ref--4-0!/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.treat.js has no id. This should not happen.

ERROR in chunk 2
2.output.bundle.js
/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.jsx
RuntimeTemplate.moduleId(): Module /Users/kompot/projects/treat-no-module-id-2/node_modules/treat/webpack-plugin/loader.js??ref--4-0!/Users/kompot/projects/treat-no-module-id-2/node_modules/babel-loader/lib/index.js??ref--5!/Users/kompot/projects/treat-no-module-id-2/src/components/module/Component2.treat.js has no id. This should not happen.
</code></pre></div>






<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Build should succeed. There are 4 "fixes" that make the build pass.<br>
<a href="https://github.com/kompot/treat-no-module-id-2/pull/1/files">https://github.com/kompot/treat-no-module-id-2/pull/1/files</a><br>
<a href="https://github.com/kompot/treat-no-module-id-2/pull/2/files">https://github.com/kompot/treat-no-module-id-2/pull/2/files</a><br>
<a href="https://github.com/kompot/treat-no-module-id-2/pull/3/files">https://github.com/kompot/treat-no-module-id-2/pull/3/files</a><br>
<a href="https://github.com/kompot/treat-no-module-id-2/pull/4/files">https://github.com/kompot/treat-no-module-id-2/pull/4/files</a></p>
<p dir="auto">The last one is probably the most interesting one — turning off</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="optimization: {
  concatenateModules: false
}"><pre class="notranslate"><code class="notranslate">optimization: {
  concatenateModules: false
}
</code></pre></div>
<p dir="auto">Others are changing dependency tree and it somehow affects the build.</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  4.42.1<br>
Node.js version: 12.16.0<br>
Operating System: macOS 10.15.4</p>
<p dir="auto">I understand that this might be at least partially related to a 3rd party project (see the <a href="https://github.com/seek-oss/treat/issues/91" data-hovercard-type="issue" data-hovercard-url="/seek-oss/treat/issues/91/hovercard">initial issue</a> in treat repo) but any help in debugging this issue would be greatly appreciated.</p>
<p dir="auto">Looks like it might be the duplicate of<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="566897362" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/10409" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/10409/hovercard" href="https://github.com/webpack/webpack/issues/10409">#10409</a><br>
if that so then should the fix be expected for webpack 4?</p>
<p dir="auto">Thanks!</p>
<p dir="auto">** I want report a some like <em>bug</em> **</p>
<p dir="auto">Probably incrorrect letter case in filenames make bundlers duplicating modules and work all library is failed.</p>
<p dir="auto">I faced with problem, when webpack and rollup duplicates modules.</p>
<p dir="auto">I am working on Windows. She is not make it differece between low and up case letters in filenames. For she 'File.js' and 'file.js' are one entity. But Unix-like systems recognize they as two diffirent entities. And bundlers (webpack, rollup) also do. Let you are working on Windows, and you make two 'import' operations, in the one you write from 'File.js', in the second you write 'file.js'. Both are reffered to same file. However bunlers make two copy of this module.</p>
<p dir="auto">I made all filenames and statement 'import from' to low case, and problem vanished. It is truth for Webpack. I don't try with rollup yet.</p>
<p dir="auto">Probably could make some sort of option for show warning about possibily making duplicate modules or option for ignore case in filenames, i don't know.</p>
<p dir="auto">Sorry for bothering you, if my issue happen usesless.</p>