Skip to content

Error: Prevent writing to file that only differs in casing or query string from already written file. #136

@strarsis

Description

@strarsis
  • Operating System: Windows 10 x64 (WSL 2)
  • Node Version: v14.15.4
  • NPM Version: 7.5.4
  • webpack Version: 5.x
  • image-minimizer-webpack-plugin Version: 2.2.0

Expected Behavior

webpack build should just run fine, without an error message because of duplicate file names.

Actual Behavior

webpack build fails with error, the files are generated.

webpack-cli] Error: Prevent writing to file that only differs in casing or query string from already written file.
This will lead to a race-condition and corrupted files on case-insensitive file systems.
[...]/images/test-1.jpg
[...]/images/test-1.jpg

Code

.img-orig {
  background: url("../images/test-1.jpg?size=1140");
}

.img-webp {
  background: url("../images/test-1.jpg?size=1140&format=webp");
}

How Do We Reproduce?

Run the webpack build. Notice the error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions