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

unsafe-eval CSP violation on 5.4.0 #865

Closed
4 tasks done
komachi opened this issue Oct 1, 2021 · 1 comment
Closed
4 tasks done

unsafe-eval CSP violation on 5.4.0 #865

komachi opened this issue Oct 1, 2021 · 1 comment

Comments

@komachi
Copy link

komachi commented Oct 1, 2021

Before you start - checklist

  • I followed instructions in documentation written for my React-PDF version
  • I have checked if this bug is not already reported
  • I have checked if an issue is not listed in Known issues
  • If I have a problem with PDF rendering, I checked if my PDF renders properly in Mozilla Firefox

Description

In 5.4.0 you changed pdfjs-dist import to /legacy/build #794

This brings back old pdf.js issue mozilla/pdf.js#10229 with regenerator-runtime facebook/regenerator#336

You can see message in browser console like: Content Security Policy: The page’s settings blocked the loading of a resource at eval (“script-src”).

Maybe we should use pdfjs-dist/web/pdf_viewer? I didn't test it yet, however. Another option would be defining globalThis.regeneratorRuntime = undefined, as described here

Steps to reproduce

Steps to reproduce the behavior:

  1. Upgrade to 5.4.0
  2. Set up CSP
  3. Try to import react-pdf
@komachi
Copy link
Author

komachi commented Oct 1, 2021

Sorry, duplicate of #862

@komachi komachi closed this as completed Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant