chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity
Other
577 stars 262 forks source link

[Bug] CORs error when publishing to Gitlab Pages #405

Closed lashmore closed 1 year ago

lashmore commented 1 year ago

I confirm:

Hugo version

hugo v0.92.0+extended darwin/amd64 BuildDate=unknown

Where is this bug showing up?

In the browser: Hugo builds the site, but something doesn't look right.

Operating system

macOS

Browser (if applicable)

Chrome 107.0.5304.87

Current behavior

The landing page and the About Me page all load fine, but the posts themselves are “Dangerous” when I access via Chrome.

I saw this Issue, but my baseURL never has "www" as part of it, as Gitlab pages have the URL structure "https:/[GITLAB_USER_NAME].gitlab.io/[NAME_OF_REPO]".

Access to fetch at 'https://gitlab.com/oauth/authorize?client_id=5059a88907e1b093c23df47d996183b101a862a5e53e099b563120d1308db2c1&redirect_uri=https://projects.gitlab.io/auth&response_type=code&state=gF-0-JpkGFuAeKM0nMOIKA==&scope=api' (redirected from 'https://lthistlethwaite-prnt.gitlab.io/icons/link.svg') from origin 'https://lthistlethwaite-prnt.gitlab.io/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Expected behavior

I expect the posts / articles to load / be viewed when I click the READ MORE button.

Steps to reproduce

Go to https://lthistlethwaite-prnt.gitlab.io/brainy-etc/ and click READ MORE on any of the posts. You'll get a Deceptive site ahead from Chrome.

Relevant log output

Access to fetch at 'https://gitlab.com/oauth/authorize?client_id=5059a88907e1b093c23df47d996183b101a862a5e53e099b563120d1308db2c1&redirect_uri=https://projects.gitlab.io/auth&response_type=code&state=gF-0-JpkGFuAeKM0nMOIKA==&scope=api' (redirected from 'https://lthistlethwaite-prnt.gitlab.io/icons/link.svg') from origin 'https://lthistlethwaite-prnt.gitlab.io/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Related code

No response

Preferred solution

No response

Other information

No response

onweru commented 1 year ago

@lashmore https://lthistlethwaite-prnt.gitlab.io/ returns 404, not found

lashmore commented 1 year ago

I set my baseURL in the config.toml to: https://lthistlethwaite-prnt.gitlab.io/brainy-etc/, which doesn't have the 404.

Interestingly, Chrome is no longer throwing the DANGEROUS warning/error, but the post itself is all zoomed in / weird looking. Example post (WIP): https://lthistlethwaite-prnt.gitlab.io/brainy-etc/post/viz/

Note, I made no changes to the deployed version of the site, so I'm confused what caused the change in behavior. Was a javascript file HTTP address in the theme updated recently, maybe?

lashmore commented 1 year ago

Oops - sorry I see my instructions had the typo!