Unformatted pages after deployment of Eleventy site from GitHub repo

I’ve just deployed on Pages an Eleventy site from my GitHub repo, but it shows unformatted on .pages.dev, previews links, and custom domain.

I’ve checked the source of .pages.dev, preview links, custom domain, and all paths of links to .css etc are correct as they are in my local building of the same output folder (_site) which locally builds correctly with all pages properly formatted.

Please, what could be causing this problem?

Can you link the pages.dev?

Sorry, I can’t understand why this problem is happening when I deploy to Pages. My local build works fine, all pages are formatted there.
Please, can someone give me some indication?

Your issue stems from the content-security-policy header you’re applying. Check your browser dev console and you’ll see a tonne of warnings about JS/CSS not executing. For example:

Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-ppTQAD09+uNeED36PKLUCm56BJFycfhnFKlKNvlHpl8='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

If I manually strip that header via a proxy on my end, your site renders fine: https://up.jross.me/435s60to

My recommendation would be to either tweak the content-security-policy header to allow your content as you need, or remove it entirely.

1 Like

Oh cherryjimbo, thank you so much! Now it works!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.