BUG: Loaders (css-loader + style-loader) can generated different modules ending with identical relative paths (`./node_modules/PKG/FILE.css`)
See original GitHub issueThanks for the great plugin!
This is my configuration:
new DuplicatesPlugin({
emitError: true,
verbose: true,
}),
This is the output I get:
WARNING in Missing sources: Expected 22, found 0.
Found map: {}
Duplicate Sources / Packages - Duplicates found! ⚠️
* Duplicates: Found 22 similar files across 22 code sources (both identical + similar)
accounting for 219534 bundled bytes.
* Packages: Found 0 packages with 0 resolved, 0 installed, and 0 depended versions.
* Understanding the report: Need help with the details? See:
https://github.com/FormidableLabs/inspectpack/#diagnosing-duplicates
* Fixing bundle duplicates: An introductory guide:
https://github.com/FormidableLabs/inspectpack/#fixing-bundle-duplicates
I guess this is some bug that it doesn’t show me what the duplicates are. Also, there are some missing sources but I don’t know where these come from.
How do I debug this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Webpack style-loader / css-loader: url() path resolution not ...
My problem was that all the url() rules (including fonts and images) were being loaded by css-loader as [object Module], and they where...
Read more >style-loader - webpack
Automatically injects styles into the DOM using multiple <style></style> . It is default behaviour. component.js import "./styles.css";. Example ...
Read more >Webpack with CSS Modules - E.Y. - Medium
style-loader injects our styles into our DOM. This will put styles into the HTML file, so no separate stylesheet. css-loader interprets @import ...
Read more >less-loader - npm
A Less loader for webpack. Compiles Less to CSS.. Latest version: 11.1.0, last published: 3 months ago. Start using less-loader in your ...
Read more >css-loader
The css-loader interprets @import and url() like import/require() and will resolve them. Good loaders for requiring your assets are the file-loader and the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the repro project. With this diff:
I’m able to get these snippets from
dist/assets/chunk.52bfef93cfbd366411ed.js
forc3/c3.css
:And so it looks like what get’s generated by the plugins are:
css-loader
: The actual CSS code in a string.style-loader
: Boilerplate JS injection code that requires thecss-loader
-generated module.Since both of the things end with the same path name (the original pure CSS file
c3/c3.css
) I will think about how best to handle this situation generally from inspectpack when two identical relative path names are legitimately different files (from plugin generation).Here is a reproduction project. It uses Ember CLI. If you’re unfamiliar with that, just
npm install
first and then run./node_modules/ember-cli/bin/ember server
. You will see the warning at the bottom of the output. You can see and change webpack’s configuration inember-cli-build.js
. Just restart the server after that.Please tell me if you need anything more from me, I’ll be glad to help.