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

[5.0 beta] http:// urls in index.html are rewritten on non-index pages #14770

Closed
7 tasks done
IanVS opened this issue Oct 26, 2023 · 0 comments · Fixed by #14774
Closed
7 tasks done

[5.0 beta] http:// urls in index.html are rewritten on non-index pages #14770

IanVS opened this issue Oct 26, 2023 · 0 comments · Fixed by #14774
Labels
p4-important Violate documented behavior or significantly improves performance (priority) regression The issue only appears after a new release

Comments

@IanVS
Copy link
Contributor

IanVS commented Oct 26, 2023

Describe the bug

I found that after 5.0.0-beta.7, I got an error on my pages:

Refused to apply style from 'http://localhost:8080/https:/fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Note the funky URL. This was transformed from my index.html link:

   <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap"/>

I narrowed it down to #14591 as the cause, but it only happens on pages that are not /, due to the check for originalUrl.

Reproduction

https://github.com/IanVS/reproduction-vite-href-rewrite

Steps to reproduce

Clone the repo, install the deps, fire up vite in dev, open the page, should redirect automatically to /page, and check the console log and the page source to see the problems.

System Info

System:
    OS: macOS 14.0
    CPU: (12) arm64 Apple M2 Max
    Memory: 684.77 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/Library/Caches/fnm_multishells/93663_1697201010821/bin/node
    npm: 9.5.1 - ~/Library/Caches/fnm_multishells/93663_1697201010821/bin/npm
    pnpm: 8.6.7 - ~/Library/Caches/fnm_multishells/93663_1697201010821/bin/pnpm
  Browsers:
    Safari: 17.0
  npmPackages:
    @vitejs/plugin-react: ^4.0.4 => 4.0.4
    vite: 5.0.0-beta.7 => 5.0.0-beta.7

Used Package Manager

pnpm

Logs

No response

Validations

@bluwy bluwy added p4-important Violate documented behavior or significantly improves performance (priority) regression The issue only appears after a new release and removed pending triage labels Oct 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p4-important Violate documented behavior or significantly improves performance (priority) regression The issue only appears after a new release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants