# How to run WebAssembly.compile(a.code) on frontend?

**URL:** <https://forum.dfinity.org/t/how-to-run-webassembly-compile-a-code-on-frontend/41323>\
**Category:** Developers\
**Created:** [February 18, 2025, 9:10am UTC](https://forum.dfinity.org/t/how-to-run-webassembly-compile-a-code-on-frontend/41323 "2025-02-18T09:10:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kayicp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kayicp/32/36679_2.png) [@kayicp](https://forum.dfinity.org/u/kayicp)\
**Post date:** [February 18, 2025, 9:10am UTC](https://forum.dfinity.org/t/how-to-run-webassembly-compile-a-code-on-frontend/41323/1 "2025-02-18T09:10:00Z")

</div>

I’ve been trying to compile a wasm code on the frontend javascript but this error has been bugging me for hours now:

```auto
Uncaught (in promise) CompileError: WebAssembly.compile(): Refused to compile or instantiate
 WebAssembly module because 'unsafe-eval' is not an allowed source of script in the following 
Content Security Policy directive: "script-src 'self'"
    at p (index-d10505ae.js:69:52328)
    at 2../src/bn128.js (index-d10505ae.js:53:92638)

```

I’ve added `meta` tag such as `<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval';">` but i still got it.

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [February 18, 2025, 9:14am UTC](https://forum.dfinity.org/t/how-to-run-webassembly-compile-a-code-on-frontend/41323/2 "2025-02-18T09:14:37Z")

</div>

You can adapt CSP headers by modifying the `.ic-assets.json5` file(s) in your project. In a project generated by `dfx new` you should find an example, otherwise we also have some (but not much) documentation [here](https://internetcomputer.org/docs/current/developer-docs/web-apps/application-frontends/asset-security). Maybe the docs chatbot is more helpful in this case.

Also, if the new headers don’t get applied try reinstalling your asset canister. IIRC there is still a problem with headers not properly updating
