Loading 3D models / Content Security Policy #1313
Unanswered
joevingracien
asked this question in
Help
Replies: 2 comments 8 replies
|
I believe the issue is caused by MeshOptDecoder from three-stdlib https://github.com/pmndrs/three-stdlib/blob/main/src/libs/MeshoptDecoder.ts As it requires and uses WebAssembly and as the error says Which is then used by useLoader (R3F) and useGLTF (drei). I believe it can be toggled of by providing a parameter on the useGLTF hook, otherwise, it should be an easy enough issue to be tackled via PR or your own implementation of useGLTF (just copy it and alter it, it should work) |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I have this piece of code:
Here is the error message I get:
Uncaught (in promise) CompileError: WebAssembly.instantiate(): Refused to compile or instantiate WebAssembly module because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' 'nonce-1127473604afbb5be4b7ca994055ee65' https://cdn.shopify.com https://shopify.com"
at MeshoptDecoder (index.js:115948:31)
at useGLTF.js:24:71
at index-6662eaf2.esm.js:1643:21
at query (index.js:51:27)
at preload (index.js:70:44)
at useLoader.preload (index-6662eaf2.esm.js:1673:10)
at useGLTF.preload (useGLTF.js:34:89)
at _index-ABCCMMWK.js:99482:9
All reactions