Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[bug]: Refused to load the stylesheet because it violates the following Content Security Policy #2979

Closed
3 of 8 tasks
sergeycherepanov opened this issue Jan 29, 2021 · 4 comments · Fixed by #2985
Closed
3 of 8 tasks
Labels
bug Something isn't working Progress: done

Comments

@sergeycherepanov
Copy link

sergeycherepanov commented Jan 29, 2021

Describe the bug
I enabled the SASS support by the official guide and it works in debug/watch mode. But after yarn build && yarn start the styles where broken and the console says:

Refused to load the stylesheet 'blob:http://0.0.0.0:8080/8e286dcc-c3ec-445d-aab8-0ad3e322891a' because it violates the following Content Security Policy directive: "style-src 'self' https: 'unsafe-inline' https://m2.hm2.space/". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

To reproduce

  1. Enable the saas support by the following guide: https://magento.github.io/pwa-studio/tutorials/enable-sass-less-support/
  2. Rename the index.css to index.scss and import in the index.js file.
  3. Build the project by the following command: yarn build
  4. Start the project by the following command: yarn start

Expected behavior

No errors in the console and styles loaded properly.

Please complete the following device information:

  • Device [PC, Mac]:
  • OS [MacOs, Windows 10]:
  • Browser [Chrome]:
  • Browser Version [e.g. 22]:
  • Magento Version: 2.4
  • PWA Studio Version: 8
  • NPM version npm -v: 6.14.10
  • Node Version node -v: v12.20.1

Please let us know what packages this bug is in regards to:

  • venia-concept
  • venia-ui
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
  • create-pwa
@sergeycherepanov sergeycherepanov added the bug Something isn't working label Jan 29, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jan 29, 2021

Hi @sergeycherepanov. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@sirugh
Copy link
Contributor

sirugh commented Feb 1, 2021

Thanks for reporting this! For what it's worth the headers are defined in the upward-security-headers extension. The solution will probably have to do with modifying the headers to allow blob.

mrbash added a commit to mrbash/pwa-studio that referenced this issue Feb 2, 2021
@magento magento deleted a comment from github-jira-sync-bot Feb 2, 2021
@magento magento deleted a comment from github-jira-sync-bot Feb 2, 2021
@magento magento deleted a comment from github-jira-sync-bot Feb 2, 2021
@sirugh
Copy link
Contributor

sirugh commented Feb 2, 2021

@magento export issue to JIRA project PWA as Bug

@magento magento deleted a comment from github-jira-sync-bot Feb 2, 2021
@github-jira-sync-bot
Copy link

✅ Jira issue (https://jira.corp.magento.com/browse/PWA-1387) is successfully created for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Progress: done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants