Hugo theme broken with CORS policy errors

site: outsiderdata.netlify.com
I’ve been running this site with the hugo blackburn theme on netlify for a few years. It “just worked,” but I needed to change so I switched to the anatole theme which has created problems with netlify it seems. The first error on the page is

Access to CSS stylesheet at https://outsiderdata.netlify.com/css/main.min.24f9f28bfaca2cdc5a222bb5e42d30c701d7ffb0b31d30dfc4afc0e044dfbf24.css'  from origin
 https://outsiderdata.netlify.app' has been blocked by CORS policy: 
No  Access-Control-Allow-Origin header is present on the requested resource

To fix the error I have followed the guidance in the relevant support docs. I made the theme a git submodule and created a netlify.toml file in the root directory that looks like the sample netlify provides the the addition of these lines. the deploy log shows the file was found.

[[headers]]
  for = "/*"
    [headers.values]
    Access-Control-Allow-Origin = "*"

No errors appear on the locally hosted site. I appreciate any help. Thanks.

Netlify switched from .com to .app subdomains sometime back in 2020 I suppose. So I think you need to change the .com domain to .app in your config.toml.

The better option would be to edit the theme and change all {{ .Permalink }} to {{ .RelPermalink }}.

1 Like

O.M.G. So much hair pulling. So many hours fiddling and tweaking. But I missed this. All I had to do was change three letters in the first line of the config.toml file. Ugh.
THANK YOU SO MUCH.