faceyspacey / faceyspacey/extract-css-chunks-webpack-plugin

Webpack 5, Multiple assets emit different content to the same filename

Open
#301 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
693
Forks
83
PR merge metrics
No merged PRs in 30d

Description

extract-css-chunks-webpack-plugin: 4.8.0
"webpack": "^5.4.0",
"webpack-dev-middleware": "^4.0.0",

I am not sure if this is the right place for this issue.

On initial build it works. If I modify some random css file, I get this error after rebuild:
ERROR in Conflict: Multiple assets emit different content to the same filename

```
[webpack-dev-middleware] Child "client": assets by status 42.9 MiB [cached] 238 assets
Entrypoint main = main.css main.js main.292ea9678ed0edbbfec7.hot-update.js 1 auxiliary asset
cached modules 14.6 MiB [cached] 3383 modules
runtime modules 40.6 KiB 18 modules
modules by path ./ 269 KiB (unknown) 219 bytes (javascript)
css modules 269 KiB 176 modules
javascript modules 219 bytes
./src/packages/cuc-flights/components/flights-header/FlightsTotals.scss 103 bytes [built]

ERROR in Conflict: Multiple assets emit different content to the same filename src_packages_cuc-flights_components_flights-header_FlightsHeader_tsx-src_packages_cuc-flights-aaca9d.css

client (webpack 5.4.0) compiled with 1 error in 3496 ms
```

if I remove the whole route then I also got:
```
[webpack-dev-middleware] HookWebpackError: Cannot read property 'getModuleIndex2' of undefined
```

if I edit some js then build succeeds again

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the initial build and CSS-only rebuild with extract-css-chunks-webpack-plugin 4.8.0, webpack 5.4.0, and webpack-dev-middleware 4.0.0, using the reported FlightsHeader CSS and route removal cases. Trace the emitted filename conflict and the getModuleIndex2 error; done means CSS and JavaScript edits rebuild without either error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.