coryhouse / coryhouse/react-slingshot

Refused to execute inline script because it violates the following Content Security Policy directive:

Open
#660 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.6k
Forks
2.9k
PR merge metrics
No merged PRs in 30d

Description

I am facing this error suddenly. My project is crushed in dev mode. Please

`Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-d8xVpEfOlXT388lPL445U0wcaE4cweRSVh5BQpm9scE='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.`

Found This error on cli:
```
in ./src/myStyle.module.css (./node_modules/css-loader/dist/cjs.js??ref--10-1!./node_modules/postcss-loader/dist/cjs.js??ref--10-2!./node_modules/sass-loader/dist/cjs.js??ref--10-3!./src/myStyle.module.css)
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.
- options has an unknown property 'plugins'. These properties are valid:
object { postcssOptions?, execute?, sourceMap? }
at validate (E:\XAMPP\htdocs\wpcli\wp-content\plugins\wpcwv\cwv-widget\node_modules\schema-utils\dist\validate.js:98:11)
at Object.loader (E:\XAMPP\htdocs\wpcli\wp-content\plugins\wpcwv\cwv-widget\node_modules\postcss-loader\dist\index.js:43:28)
```

No CSS/SCSS/SASS file is loaded.

I have updated all loader and packages. Lots of Google search but nothing happens.

Without CSS or other style application worked as well.

Have you any solve? Please help

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the PostCSS Loader configuration used for src/myStyle.module.css and compare its options with the reported postcss-loader API schema. Reproduce the dev build with that stylesheet; done means CSS/SCSS/SASS loads successfully without the loader validation failure or resulting CSP error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.