Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchpriority attribute in <script> is stripped from index.html after build #18061

Open
7 tasks done
ferferga opened this issue Sep 9, 2024 · 2 comments
Open
7 tasks done
Labels
feat: html p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@ferferga
Copy link

ferferga commented Sep 9, 2024

Describe the bug

If an script element is given a valid fetchpriority attribute () in the entrypoint's index.html, it is completely stripped away in the output.

Reproduction

https://stackblitz.com/edit/vue3-vite-typescript-starter-f76uyg?file=index.html

Steps to reproduce

  1. Install the dependencies of the stackblitz playground (if not done automatically)
  2. Check how fetchpriority is set in the root index.html's main script tag and build the application with npm run build.
  3. Check how fetchpriority is missing from the build output at dist/index.html.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-vue: 5.1.3 => 5.1.3 
    vite: 5.4.3 => 5.4.3

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Sep 9, 2024

@ferferga ferferga changed the title fetchpriority attribute is stripped from index.html after build fetchpriority attribute in <script> is stripped from index.html after build Sep 9, 2024
@bluwy
Copy link
Member

bluwy commented Sep 10, 2024

I think this is likely the same issue as #17322, instead of <link>, Vite also re-constructs the script tags (for cases like combining multiple scripts).

@bluwy bluwy added feat: html p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: html p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

2 participants