Loading 3D models / Content Security Policy #1313
Replies: 2 comments 8 replies
-
Maybe @blittle can help |
Beta Was this translation helpful? Give feedback.
-
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) |
Beta Was this translation helpful? Give feedback.
-
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
Beta Was this translation helpful? Give feedback.
All reactions