Page 1 of 1

Navbar not appearing on production server but works on localhost

Posted: Tue Aug 16, 2022 3:38 pm
by shahmiteshk

The project works perfect on localhost but when I move it on my server the nav bar does not come up and not of the actions are performed. Some kind of JS errors as below. This is in chrome

Error with Feature-Policy header: Unrecognized feature: 'vibrate'.
BrandList:412 Refused to load the image 'data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343A40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e' because it violates the following Content Security Policy directive: "img-src 'unsafe-inline' 'self' *". Note that '*' matches only URLs with network schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme matches `self`'s scheme. The scheme 'data:' must be added explicitly.
BrandList:1 Refused to load the image 'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/…oP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=' because it violates the following Content Security Policy directive: "img-src 'unsafe-inline' 'self' *". Note that '*' matches only URLs with network schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme matches `self`'s scheme. The scheme 'data:' must be added explicitly.
jsrender.js:1878 Uncaught
l {name: 'JsRender Error', message: `Syntax error\nCompiled template code:\n\n// navbar/if…rective: "script-src 'unsafe-inline' 'self' *".\n"`}
message: "Syntax error\nCompiled template code:\n\n// navbar/if/for/if\nvar v,ret=\"\"+\"nav-item ew-navbar-item\";\nreturn ret;\n: \"Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'unsafe-inline' 'self' *\".\n\""


Re: Navbar not appearing on production server but works on localhost

Posted: Tue Aug 16, 2022 4:31 pm
by arbei

Are you trying to use a data URL as brand logo? How did you specify the logo? If you have customized the navbar template or use some extension, you better post your code for discussion.


Re: Navbar not appearing on production server but works on localhost

Posted: Tue Aug 16, 2022 5:01 pm
by shahmiteshk

I am not using any images for logo. There is no custom template, using the default one


Re: Navbar not appearing on production server but works on localhost

Posted: Tue Aug 16, 2022 7:41 pm
by arbei

shahmiteshk wrote:

it violates the following Content Security Policy directive: "img-src 'unsafe-inline' 'self' *".

You better review your web server's default headers, read Content-Security-Policy.