Skip to content

[Bug]: Incorrect html output when using compilation hooks and upper case letters in asset file names #8410

@mochiya98

Description

@mochiya98

System Info

System Info
  System:
    OS: macOS 15.0
    CPU: (11) arm64 Apple M3 Pro
    Memory: 57.17 MB / 18.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 20.15.0 - ~/.anyenv/envs/nodenv/versions/20.15.0/bin/node
    Yarn: 1.22.22 - ~/.anyenv/envs/nodenv/versions/20.15.0/bin/yarn
    npm: 10.7.0 - ~/.anyenv/envs/nodenv/versions/20.15.0/bin/npm
    pnpm: 9.12.3 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 130.0.6723.117
    Edge: 130.0.2849.80
    Safari: 18.0
  npmPackages:
    @rspack/cli: ^1.1.0 => 1.1.0 
    @rspack/core: ^1.1.0 => 1.1.0 
    @rspack/plugin-react-refresh: 1.0.0 => 1.0.0 

Details

when not using hooks (valid):

<script src="/fooBar.js"></script>

when using hooks (invalid):

<script src="/foobar.js"></script><!-- 404 -->

This could be the cause:

attr_value: Some(x.cow_to_ascii_lowercase().into_owned()),

Reproduce link

No response

Reproduce Steps

Create a rspack project to output assets that contain uppercase letters, e.g.:

{
  entry: {
    foorBar: "./src/main.js",
  },
}

and add plugin includes rspack.HtmlRspackPlugin hooks
https://rspack.dev/blog/announcing-1-1#improved-html-plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpending triageThe issue/PR is currently untouched.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions