Unable to use styled-components
See original GitHub issuestyled-components.browser.esm.js:133 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.
It is unable to add style now.
I tried to add
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
callback({
responseHeaders: {
'Content-Security-Policy': ["default-src 'self' 'unsafe-inline' 'unsafe-eval'"],
...details.responseHeaders,
},
});
});
But still can’t get around this.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Extending styles with styled-components not working
I'm trying to extend styles for a react component using styled-components but is not working. AFAIK, I'm doing it the right way, ...
Read more >FAQs - styled-components
In a React Native project using TypeScript, it is because you need to add @types/styled-components-react-native.
Read more >Module not found: Can't resolve 'styled-components'
To solve the error "Module not found: Error: Can't resolve 'styled-components'", make sure to install the styled-components package by opening your terminal ...
Read more >styled-components - npm
Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress. Latest version: 5.3.6, ......
Read more >Unable to install styled-components module : r/reactnative
Hi All, I am trying to install styled components to my expo managed react native ... use npm install --force or better yet,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a new library for me, thank you for sharing. I take it with your earlier modification adding
'unsafe-inline'
is the way to go to use styled-components. Thank you for sharing your solution with us here.Relevant to #53