You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, there is a workaround to this issue which is to use unsafe-inline in style-src and not nonce-${nonce}. But this might not be best case since it might introduce to some security vulnerabilities to the application.
Your environment
npx @mui/envinfo
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 22.12.0 - C:\Program Files\nodejs\node.EXE
npm: 11.0.0 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: Not Found
Edge: Chromium (132.0.2957.115)
npmPackages:
@emotion/react: ^11.14.0 => 11.14.0
@emotion/styled: ^11.14.0 => 11.14.0
@mui/core-downloads-tracker: 6.4.8
@mui/material: ^6.4.8 => 6.4.8
@mui/material-nextjs: ^6.4.3 => 6.4.3
@mui/private-theming: 6.4.8
@mui/styled-engine: 6.4.8
@mui/system: 6.4.8
@mui/types: 7.2.24
@mui/utils: 6.4.8
@types/react: ^19 => 19.0.12
react: ^19.0.0 => 19.0.0
react-dom: ^19.0.0 => 19.0.0
typescript: ^5 => 5.8.2
aarongarciah
changed the title
[skeleton] Skeleton not rendered when Strict CSP is applied in Next.js
[Skeleton] Not rendered when Strict CSP is applied in Next.js
Mar 26, 2025
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
Steps to reproduce
Steps:
Current behavior
Only one Skeleton component is shown on screen
Expected behavior
Two Skeleton components should be shown on screen
Context
I want to show loading skeleton for sidebar and header. However, when strict csp is applied, only one skeleton is shown. The configuration for strict csp is based on this link (https://nextjs.org/docs/app/building-your-application/configuring/content-security-policy)
However, there is a workaround to this issue which is to use
unsafe-inline
instyle-src
and notnonce-${nonce}
. But this might not be best case since it might introduce to some security vulnerabilities to the application.Your environment
npx @mui/envinfo
Search keywords: nextjs, strict-csp, content-security-policy, css, unsafe-inline, nonce, skeleton
The text was updated successfully, but these errors were encountered: