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

Legacy script is injected with an incorrect relative path in the built HTML file when using @vitejs/plugin-legacy:5.4.2 #18256

Closed
7 tasks done
gyutaesi opened this issue Oct 2, 2024 · 1 comment

Comments

@gyutaesi
Copy link

gyutaesi commented Oct 2, 2024

Describe the bug

When using the @vitejs/plugin-legacy plugin with Vite, the polyfill script is injected into the built index.html file with an incorrect path.
Even after setting the base option, the path for the polyfills-legacy script lacks an absolute path (e.g., /assets/), causing the browser to throw an error, as it cannot locate the polyfill file.

The above issue does not occur in version 5.4.1, but only in version 5.4.2

Reproduction

none

Steps to reproduce

Run npm install & npm run build

System Info

System:
    OS: macOS 14.6.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 121.41 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.7.1 - ~/.nvm/versions/node/v21.7.1/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v21.7.1/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v21.7.1/bin/npm
    pnpm: 9.6.0 - ~/.nvm/versions/node/v21.7.1/bin/pnpm
  Browsers:
    Edge: 125.0.2535.92
    Safari: 17.6

Used Package Manager

npm

Logs

No response

Validations

Copy link

github-actions bot commented Oct 2, 2024

Hello @gyutaesi. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants