-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Bug:Cannot load resources that start with //. #15335
Comments
It seems that |
In versions prior to vite@5.0.8, this error did not exist. It only appeared after I upgraded to 5.0.8. I cannot forcibly add the prefix 'https' or 'http' because this project will run in different environments, so it must be relative. Therefore, I hope vite can either ignore this type of relative error or not prompt this error as it did before. |
Thank you for the reminder, this could be a problem. |
noticed same error in terminal also on particular ./ import error introduced vite@5.0.8 and still there in vite@5.0.9
This from Storybook generated HTML, which references file twice:
the file is actually served, can navigate to it, and the page runs with no error in browser, maybe the there are many other ./ files in the HTML that do not error, such as: |
Sorry, I can't reproduce the issue you provided. Could you please provide a minimal reproduction repository? |
error happens from clean install. mac,
to confirm deps this gave me ... "dependencies": { run dev server: |
The issue you described is related to #15374. @anewstead |
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
vite@5.0.8
Steps to reproduce
<script src="//at.alicdn.com/t/c/font_3604131_25pwmwrknp2.js"></script>
in the index.html file in the root directory.npm run dev
to start the development server.[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
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: