Skip to content

HAMUR_E0027: Inline styles are on while the CSP refuses them

Inline styles are on while the CSP refuses them. Error HAMUR_E0027 belongs to hamur, config, environment and command line (0001 – 0999).

Message

text
HAMUR_E0027 build.inlineStyles needs 'unsafe-inline' in style-src or server.csp.mode "nonce": the hash of an inline style is not written

Cause

build.inlineStyles is on, but the CSP does not allow the styles it inlines: style-src has no 'unsafe-inline' and server.csp.mode is not "nonce". The hash of an inline style is not written.

Fix

Add 'unsafe-inline' to style-src, set server.csp.mode to "nonce", or turn build.inlineStyles off.