-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Bug:Cannot load resources that start with //. #15335
Copy link
Copy link
Closed
Labels
Description
Describe the bug
Adding font resources that start with // in the index.html file in the root directory causes an error in the console. The error message is [vite] Pre-transform error: Failed to load url //at.alicdn.com/t/c/font_3604131_25pwmwrknp2.js (resolved id: //at.alicdn.com/t/c/font_3604131_25pwmwrknp2.js). Does the file exist?
Reproduction
Steps to reproduce
- Create an empty project with Vite.
- Add
<script src="//at.alicdn.com/t/c/font_3604131_25pwmwrknp2.js"></script>in the index.html file in the root directory. - Run
npm run devto start the development server. - Make changes and save them locally to trigger hot-reloading.
- Encounter an error :
[vite] Pre-transform error: Failed to load url //at.alicdn.com/t/c/font_3604131_25pwmwrknp2.js (resolved id: //at.alicdn.com/t/c/font_3604131_25pwmwrknp2.js). Does the file exist?
System Info
System:
OS: macOS 12.4
CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Memory: 109.20 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.10.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.6.11 - /usr/local/bin/pnpm
Browsers:
Chrome: 120.0.6099.71
Safari: 15.5Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable