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

CSP error - Refused to compile or instantiate WebAssembly module because 'wasm-eval' is not an allowed source of script in the following Content Security Policy directive #146

Closed
pablogravielseo opened this issue Jul 19, 2018 · 4 comments

Comments

@pablogravielseo
Copy link

Hi, I got the following error: Refused to compile or instantiate WebAssembly module because 'wasm-eval' is not an allowed source of script in the following Content Security Policy directive:

csp-error

I have tried to add "wasm-eval" in CSP but nothing, same error appears, I have searched about too but nothing.

@puzrin
Copy link
Member

puzrin commented Jul 19, 2018

WebAssembly/content-security-policy#7

Seems you need unsafe-eval. Type error message in google and see results.

pica/dist/pica.js

Line 1467 in e12af7c

var instance = new WebAssembly.Instance(module, {});

Appropriate code is wrapped into try/catch, don't know why this is not handled. If you have idea how to improve detection logic - let me know.

@puzrin
Copy link
Member

puzrin commented Jul 19, 2018

Does pica fallback to JS implementation or crash?

@pablogravielseo
Copy link
Author

Hi @puzrin, the value "unsafe-eval" is already present in script source and the same error continue.
Seems that fallback to JS implementation.

picajs-csp-wasm-eval-error

I'm still looking for a solution.

@puzrin
Copy link
Member

puzrin commented Jul 24, 2018

If pica works (resize images) - then issue not for this repo.

@puzrin puzrin closed this as completed Jul 24, 2018
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

2 participants