Skip to content

[vite:build-html] URI malformed #19199

@lubomirblazekcz

Description

@lubomirblazekcz

Describe the bug

href attribute in html that contains #% fails during build, this worked previously in 5.4.2 (not since)

Reproduction

https://stackblitz.com/edit/vitejs-vite-xtansfhc?file=index.html&terminal=dev

Steps to reproduce

run vite build

System Info

System:
    OS: macOS 15.1
    CPU: (10) arm64 Apple M4
    Memory: 1.89 GB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.6.0 - /opt/homebrew/bin/node
    npm: 11.0.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 131.0.6778.265
    Safari: 18.1
  npmPackages:
    vite: ^6.0.7 => 6.0.7

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: htmlp2-edge-caseBug, but has workaround or limited in scope (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions