# CSP error after enabling xpack (Dark mode broken)

**URL:** <https://discuss.elastic.co/t/csp-error-after-enabling-xpack-dark-mode-broken/264955>\
**Category:** Kibana\
**Created:** [February 20, 2021, 3:40pm UTC](https://discuss.elastic.co/t/csp-error-after-enabling-xpack-dark-mode-broken/264955 "2021-02-20T15:40:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmitryyankowski](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@dmitryyankowski](https://discuss.elastic.co/u/dmitryyankowski)\
**Post date:** [February 20, 2021, 3:40pm UTC](https://discuss.elastic.co/t/csp-error-after-enabling-xpack-dark-mode-broken/264955/1 "2021-02-20T15:40:38Z")

</div>

Current version: **7.11.1**

Hi there, i've just enabled xpack.. and logged in and i'm seeing the following error in my console:

```auto
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.

```

I had dark mode enabled before I enabled xpack and it was working just fine.. but now it look's like this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ecb97cca2b3dab12f395009ba369870affa35000.png)

And my Observability page look's like this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2a0d0dda59966b70a26e252b0b8a4925da7b2790.png)

Anyone know how to fix this?

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [February 22, 2021, 10:21pm UTC](https://discuss.elastic.co/t/csp-error-after-enabling-xpack-dark-mode-broken/264955/2 "2021-02-22T22:21:41Z")

</div>

The console message you saw is expected. There should be an additional line logged to the console as well, shortly after this that looks like this:

```auto
^ A single error about an inline script not firing due to content security policy is expected!

```

Do you see one of those?

The UI looks like it's not rendering correctly. I assume it does this if you refresh the page, or close the page and re-open in another tab?

Any other messages in the browser? Does the network tab show any errors? Were there any errors logged in the Kibana server logs?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 22, 2021, 10:22pm UTC](https://discuss.elastic.co/t/csp-error-after-enabling-xpack-dark-mode-broken/264955/3 "2021-03-22T22:22:08Z")

</div>

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