-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RuntimeError: Refused to compile or instantiate WebAssembly module because 'unsafe-eval' #2815
Comments
+1. am facing this issue too! |
I figured it out mate, it's about enforcing a very specific set of resolutions (sub dependency package versions) @react-pdf/renderer@3.1.2 |
cool! thanks for figuring it out @paul-gansca 👍 setting those specific resolutions fixed it for me as well |
I am still facing the issue, tried these versions and still having the issue. anyone have any idea? |
Have you checked with "npm ls" that you indeed have these versions? I was only able to enforce the the sub-dependency version using yarn btw. |
@paul-gansca You were right, it wasn't getting the correct packages, I had to roll back yarn.lock to and add it in the "resolutions" and it worked |
Describe the bug
I have just migrated from CRA to Vite 5.2.0 and as I was testing my app for any issues caused by this I find that I can no longer use @react-pdf/renderer (specifically ) to create a PDF because of a CSP issue. It still works if I add the unsafe-eval to the CSP string but I'm sure there has to be a better way. I'm also curious as to why it was working before.
Using ASP.NET on the BE with Dotnet 6.
To Reproduce
Running the client app on it's own doesn't throw any errors.
Running the app through the port which then has a websocket to connect to my server is when I'm getting the error.
Previously when using CRA this was not an issue.
I'm wondering if there is some extra config I need to do to handle stuff in VITE which may have been automatically done by CRA.
I'm using
"@react-pdf/renderer": "^3.2.0",
"vite": "^5.2.0",
On loading the page where I use component I get the error in the screenshot above.
Expected behavior
I'm hoping to get it working as it was with CRA without having to use 'unsafe-eval'
Desktop (please complete the following information):
I've seen this issue mentioned in this thread but didn't seem like it was resolved:
#510
The text was updated successfully, but these errors were encountered: