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

Multilingual sites on different domains don't load JavaScript and CSS #627

Closed
Magneticdud opened this issue Mar 4, 2024 · 1 comment
Closed

Comments

@Magneticdud
Copy link
Contributor

Magneticdud commented Mar 4, 2024

On v4, there's the integrity check on theme.css and theme.js

As I wrote on this discussion, I found out that secondary language sites hosted on separate domains won't load the content of those three files, breaking the site.

On the browser console, it says three errors like

Subresource Integrity: The resource 'https://www.example.com/theme.min.83a50f6….js' has an integrity attribute, but the resource requires the request to be CORS enabled to check the integrity, and it is not. The resource has been blocked because the integrity cannot be enforced.

I enabled the CORS header on the server but no browser rendered that. It seems like that, according to this documentation an additional crossorigin="anonymous" parameter is needed.

I created a pull request for this.

Now, maybe a better approach is to have those three files linking to the baseURL of the specific language, but I have no idea to do that. I tried to fiddle using .Site.BaseURL but I wasn't able to get that cache-busting string after the filename.

@igor-baiborodine
Copy link
Collaborator

Fixed in PR #628.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants