fmodstudio.js:1 Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' ws:".
This error originates by loading fmod in the .html file (or does fmodstudio api contain an eval() function?)
Currently I load fmodstudio in an .html via
<script type="text/javascript" src="/static/audio/fmodstudio.js" importance="low"></script>
how can it be loaded in a .js file like this:
import { FMOD } from "../fmodstudio.js"
?
Explanation on CSP here:
Thank you!
1 Like
If you are using node, just put it into a custom node module and npm install it. Then import it and viola. Youâll need to make very minor changes to the base fmodstudio.js, but itâs not anything huge really. (Or you can just make sure the additional file is included in the /public/static/js/ folder)
âfmodstudio.js [Report Only] Refused to compile or instantiate WebAssembly module because âwasm-evalâ is not an allowed source of script in the following Content Security Policy directive: âscript-src âselfâ âunsafe-evalâ ws:â.â
eval() is not allowed in the code.