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

Cannot load stylesheet, Failed integrity metadata check #180

Closed
ecthrwatch opened this issue Apr 5, 2022 · 5 comments
Closed

Cannot load stylesheet, Failed integrity metadata check #180

ecthrwatch opened this issue Apr 5, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@ecthrwatch
Copy link
Contributor

ecthrwatch commented Apr 5, 2022

UPDATE: if in layouts/partials/head.html
I change $eurekaCSS.Permalink
To $eurekaCSS.RelPermalink | absLangURL
It seems to work.
It might be related to Hugo: gohugoio/hugo#8109

Here is what my languages.yaml looks like:

en:
languageCode: en
languageName: English
title: Nicholas Burns (non-official)
contentDir: content/en
baseURL: 'https://nicholas-burns.united-states-of-america.eu'

fr:
languageCode: fr
languageName: French - Français
title: Nicholas Burns (non officiel)
contentDir: content/fr
baseURL: 'https://nicholas-burns.etats-unis.eu'

zh:
languageCode: zh
languageName: Chinese - 简体中文
title: Nicholas Burns (非官方网站)
contentDir: content/zh
baseURL: 'https://nicholas-burns.meiguo.eu'

Describe the bug

When I visit

https://nicholas-burns.united-states-of-america.eu

the page loads normally. The stylesheet is properly loaded from this link:

https://nicholas-burns.united-states-of-america.eu/css/eureka.min.6a378a23360d238dc3ef4df2f5cd718093f02c10c9c7eb2437c29701cd8d389ab6da5d9f21bdd3afa305fd56c1235017.css

But if I visit the French version of the website

https://nicholas-burns.etats-unis.eu

it fails. It cannot load the stylesheet due to a failed integrity metadata check. I noted that it also points to this link:

https://nicholas-burns.united-states-of-america.eu/css/eureka.min.6a378a23360d238dc3ef4df2f5cd718093f02c10c9c7eb2437c29701cd8d389ab6da5d9f21bdd3afa305fd56c1235017.css

Expected behavior

If I visit the French version, it should point to the correct baseURL as defined in languages.yaml which is https://nicholas-burns.etats-unis.eu for the French version.

Screenshots

Screen Shot 2022-04-05 at 23 21 28

Environment

  • Hugo Version: [e.g. v0.96.0]
  • Eureka Version: [e.g. v0.9.1]
@ecthrwatch ecthrwatch added the bug Something isn't working label Apr 5, 2022
wangchucheng added a commit that referenced this issue Apr 11, 2022
@ecthrwatch
Copy link
Contributor Author

I think this issue might have to be reopened.

  1. I am not sure to remove:
    integrity="{{ $eurekaCSS.Data.Integrity }}"
    is the right solution.

  2. I don't know anything about Hugo. However, in "head.html", I tried to change

to and it worked!

So, instead of $eurekaCSS.Permalink, use $eurekaCSS.RelPermalink | absLangURL?

You can read more about this here:
gohugoio/hugo#8109 (comment)

What do you think wangchucheng?

@wangchucheng
Copy link
Owner

wangchucheng commented Apr 13, 2022

What is your "tried to change to "? It seems that something were missing.

I did not test what would happen if the site were hosted in different domains, so you may be true and I will have a look at it later.

@ecthrwatch
Copy link
Contributor Author

Sorry, I posted code directly, I didn't pay attention. I am not use to comment on GitHub.

`

{{- $eurekaJS := resources.Get "js/eureka.js" | resources.ExecuteAsTemplate "js/eureka.js" . | minify | fingerprint "sha384" }}

<script defer src="{{ $eurekaJS.RelPermalink | absLangURL }}" integrity="{{ $eurekaJS.Data.Integrity }}"></script>`

@ecthrwatch
Copy link
Contributor Author

It still doesn't show properly, here is a screenshot.

I was going to open a second ticket but I am going to post a another comment instead since I believe all of this might be related to the same issue. I am not certain whether it's a bug or not but I think it might be.

Screen Shot 2022-04-13 at 12 18 07

@ecthrwatch
Copy link
Contributor Author

This is a similar problem. I hesitate whether I should open a second ticket or not. I will let you decide.
There are 3 websites:
Denise-Bauer.Meiguo.eu
Denise-Bauer.Etats-Unis.eu
Denise-Bauer.United-States-of-America.eu

Last night, I launched the first 2 but not the third one. The baseURL is set per language. Furthermore, I 1 distinct repo per hostname so that the Chinese version is hosted in China. The French version is hosted in France. The English version is hosted in the United States. There are multiple reasons why I decided to follow such a setting and I am not going to enter into too much details now.

So, after I launched the first 2 websites, the picture on the front page didn't load because it was trying to download the picture from Denise-Bauer.United-States-of-America.eu rather than Denise-Bauer.Meiguo.eu or Denise-Bauer.Etats-Unis.eu.

I am not sure if it's a bug or a mistake I made when I configure the website, but I believe it's in the same vein as the problem I previously mentioned.

What do you think?

Screen Shot 2022-04-13 at 12 22 03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants