You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed that after the migration to Vite5, in production, most CSS imports contain the crossorigin attribute (after #12991).
But in some cases, we noticed it was missing.
For example:
<!-- In most pages this asset is added with crossorigin --><linkrel="stylesheet" crossoriginsrc="cdn.blabla.test/some-css-123123.css"><!--In other pages is added without --><linkrel="stylesheet" src="cdn.blabla.test/some-css-123123.css">
This leads to problems when we cache the file response without crossorigin and later the browser tries to use it for the import with crossorigin.
Access to CSS stylesheet at 'https://cdn.getyourguide.com/tf/assets/compiled/client/assets/css-slider-card-CMnb0hfz-v2
'from origin 'https://www.getyourguide.com/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
header is present on the requested resource.
The issue is coming from this line: mportAnalysisBuild.ts#L126
We add the crossorigin for JS but not for CSS.
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.
Describe the bug
We noticed that after the migration to Vite5, in production, most CSS imports contain the
crossorigin
attribute (after #12991).But in some cases, we noticed it was missing.
For example:
This leads to problems when we cache the file response without
crossorigin
and later the browser tries to use it for the import withcrossorigin
.The issue is coming from this line: mportAnalysisBuild.ts#L126
We add the crossorigin for JS but not for CSS.
Reproduction
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: