Support Forums

None of my tag pages are working, but they work locally

Page is davidrhoden-basic.netlify.app or davidrhoden.com. It’s an #eleventy site (no tag for that yet).

I just got finished diagnosing an error that stopped my site from building at all. Now it builds ok, though slowly (usually over seven minutes) but more importantly, none of the “tag” related pages show up.

On my local site the tag pages lead to the posts with those tags. On Netlify I get a 404 error. An easy way to see this is to go to my tags list page: https://davidrhoden.com/tagslist/

In my local build all of these links work. On the Netlify (production) site, they don’t. Really puzzled by this.

Anybody got any thoughts?

Hi @davidrhoden,

That’s a strange problem. Netlify will build what you ask it to build - so there’s no reason for the discrepancy as long as your GitHub repo is in-sync with the local files.

If you still think it’s an issue, it would be great if you could share the repo so we could check.

Tags aren’t working locally anymore either, on either of my two recently-used branches. It’s a mystery.
I looked to see if I had done something like accidentally delete the tags collection but if I did I don’t see where I did it. I have been working with tags a bit but I tried commenting most of my improvements out, still no dice.

The site is davidrhoden-basic.netlify.app.
Github repo is https://github.com/davidrhoden/davidrhoden-basic-netlify.

I guess it would have helped to look at Inspector and see what the error is. It’s this:

Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-2daR3BDHUgNt2bWp/u+3CNDJtsIDrpz+22+QPnNNS5c='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.

It’s only on “tags” pages.

It’s the browser-sync scruipt that’s breaking.

    document.write("<script async src='/browser-sync/browser-sync-client.js?v=2.27.5'><\/script>".replace("HOST", location.hostname));

Unfortunately your repository is private.

Not sure why you are using document.write to include the script. The replace is meant to replace the string "HOST" however it doesn’t exist in the string, so I’m also not sure why that is there. And I cannot see this on the /taglist page.

coelmay, thanks for looking. I’ve made the repository public (sorry, I thought I had already done that).

I didn’t put in that browsersync code (as far as I know), and I don’t know where it comes from. Frankly, I thought it was something Eleventy or Netlify added.

The long and short of it @davidrhoden is that although I can see a tags.njk in layouts, no /tags page, or directory with pages (ie. /tags/loki/) is ever built into _site.


coelmay, you are right. I had moved the file that builds those from the root directory into the _includes/layouts directory. It seemed to work, I guess because the previously created tags pages were still in the _site directory.

I’d still love to know why I was suddenly getting Content Security Policy errors (though that also seems fixed for now) but I’ll research that myself.

Thank you for your time. I would probably not have figured that out on my own.

1 Like