Skip to content

CSP script-src error  #1074

@germsb

Description

@germsb

Version

3.0.0-beta.6

Steps to reproduce

  1. vue create testapp
  2. Setup as you want.
  3. Add productionSourceMap: false in vue.config.js.
  4. Build and push dist folder to your server.
  5. Add CSP header in your server config.

Content-Security-Policy-report-only "default-src 'none'; script-src 'self'; img-src 'self' data:; style-src 'self' ";

  1. Open the app in browser

What is expected?

according to the Vuejs doc there should be no problem

What is actually happening?

The page return an error

[Report Only] Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-aMW8RJ8d9m3crvBSAvcz8B/pG hlL4Sa2UuvzcOXfAE='), or a nonce ('nonce-...') is required to enable inline execution.


Do you have an idea to get around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions