Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refused to execute inline script #1923

Closed
metapodcod opened this issue Dec 26, 2021 · 4 comments
Closed

Refused to execute inline script #1923

metapodcod opened this issue Dec 26, 2021 · 4 comments

Comments

@metapodcod
Copy link

Issue details

Please provide issue details here.

  • Even though I didn't make any changes to my code, when I woke up in the morning I ran my "gulp" project and got such a strange error

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-ACotEtBlkqjCUAsddlA/3p2h7Q0iHuDXxk577uNsXwA='), 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.

  • the seventh line is said to have an error, the content of the seventh line is as follows
<script id="__bs_script__">//<![CDATA[
    document.write("<script async src='/browser-sync/browser-sync-client.js?v=2.27.7'><\/script>".replace("HOST", location.hostname));
//]]></script>

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [ 2.27.7 ]
  • Node [ 14.18.2 ]
  • Npm [ 8.3.0 ]

Affected platforms

  • [ x ] linux- Windows10 WSL

Browsersync use-case

  • [ x ] Gulp
@curtisbarnard
Copy link

I'm getting this same response on an 11ty project that I'm working on...

@eredwan
Copy link

eredwan commented Jun 23, 2022

I am having the same problem trying to run in Angular13. This wasnt happening before I upgraded running on Angular 5. Does anyone have any ideas on how to fix this? Extremely frustrating

@youxiuchen
Copy link

我也遇到了同样的问题,不知如何解决

@shakyShane
Copy link
Contributor

fixed in browser-sync@2.28.0 :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants