New component does not display on theme when activate it

Hi,

I tried to activate theme components (like TableTOC). I can not see it display when refresh, but it still displays on “preview” mode. I completed these actions:

  1. Active component
  2. Set current theme to run component
  3. Config component

I 'm in newest version of discourse now.
Do you have any idea? Do I must rebuild the app after install components?

Did you refresh your browser?

1 Like

Yes, I refresh my browser with CTRL F5 (chrome)

1 Like

Hi, I check in cognito session (no cookies). It is ok.
It seems caused by discourse cache.

Now my old session on browser still not display, but I do not want to delete all browser cookies.
Do you have any way to clear this cache after install?

I don’t think the issue is caching.

Do you have multiple themes enabled on your site? Did you add the component to all of them?

If you have multiple themes enabled, check your user preferences here.

your.site.com/my/preferences/interface

user preference theme setting

and make sure that you’ve added the component to that particular theme as well.

I checked this, I used only “Light” theme. “Dark” theme was disabled.
In my account also does not have option to choose theme.

I could see new components now, after a few hours. It seems still cache or st like that.

Are you getting any error in the javascript console of your browser?

Yes, there are somthing here.
But now it is ok. So I do not know whether these caused issue.

3_application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:23697 To prevent errors, add a `pluginId` key to your changes when calling `modifyClass`
ne @ _application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:23697
_application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:609 Deprecation notice: route:discovery.parentCategory was replaced with route:discovery.category (deprecated since Discourse 2.6.0)
e.default @ _application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:609
2_application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:23697 To prevent errors, add a `pluginId` key to your changes when calling `modifyClass`
ne @ _application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:23697
_application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:609 Deprecation notice: route:discovery.categoryWithID was replaced with route:discovery.category (deprecated since Discourse 2.6.0)
e.default @ _application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:609
_application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:23697 To prevent errors, add a `pluginId` key to your changes when calling `modifyClass`
ne @ _application-3ca35ac01b4a7010e8c1439da39151eaeebce0d091baab0caf5f0413b2149080.js:23697
gtm.js?id=GTM-PMQ7HQM:244 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src https://help.working24.net/logs/ https://help.working24.net/sidekiq/ https://help.working24.net/mini-profiler-resources/ https://help.working24.net/assets/ https://help.working24.net/brotli_asset/ https://help.working24.net/extra-locales/ https://help.working24.net/highlight-js/ https://help.working24.net/javascripts/ https://help.working24.net/plugins/ https://help.working24.net/theme-javascripts/ https://help.working24.net/svg-sprite/ https://www.googletagmanager.com/gtm.js 'nonce-8ad89553320c0200c84fb9e93e7254a7' https://gc.kis.v2.scr.kaspersky-labs.com wss://gc.kis.v2.scr.kaspersky-labs.com". Either the 'unsafe-inline' keyword, a hash ('sha256-B6lPd158nbG8rCxsx2kpy/8ua86KST6EpT4plGVsNqY='), or a nonce ('nonce-...') is required to enable inline execution.

(anonymous) @ gtm.js?id=GTM-PMQ7HQM:244
gtm.js?id=GTM-PMQ7HQM:244 Refused to load the script 'https://connect.facebook.net/vi_VN/sdk.js' because it violates the following Content Security Policy directive: "script-src https://help.working24.net/logs/ https://help.working24.net/sidekiq/ https://help.working24.net/mini-profiler-resources/ https://help.working24.net/assets/ https://help.working24.net/brotli_asset/ https://help.working24.net/extra-locales/ https://help.working24.net/highlight-js/ https://help.working24.net/javascripts/ https://help.working24.net/plugins/ https://help.working24.net/theme-javascripts/ https://help.working24.net/svg-sprite/ https://www.googletagmanager.com/gtm.js 'nonce-8ad89553320c0200c84fb9e93e7254a7' https://gc.kis.v2.scr.kaspersky-labs.com wss://gc.kis.v2.scr.kaspersky-labs.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
1 Like

Welll at least one of your scripts appears to be failing to load because you’ve not added the url path to your CSP.

Well, how could I fix this?

The setting entitled content security policy script source needs to contain the url folder path of your offsite dependencies. You don’t need to include the actual script name.

Is it here?

Could you give example in my case? Like:

/logs/
/mini-profiler-resources/

This for example …

1 Like