s3xysteak / vite-plugin-cesium-build

A devDependencies used to automatically configure CesiumJS for development and build with Vite.
MIT License
18 stars 2 forks source link

Error when loading draco compressed models while using @cesium/engine #10

Closed jfayot closed 2 months ago

jfayot commented 2 months ago

When using the plugin in its default mode (import cesium from 'vite-plugin-cesium-build') I can load draco compressed models without any issue.

If I switch to @cesium/engine (import cesium from 'vite-plugin-cesium-build/engine'), I get the following error:

failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 64 6f @+0
(anonyme) @ chunk-TTI2SUWJ.js:817
chunk-TTI2SUWJ.js:415 Aborted(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 64 6f @+0)
f @ chunk-TTI2SUWJ.js:415
@cesium_engine.js?v=4aebc6e8:154021 RuntimeError
message: "Failed to load model: CesiumMilkTruck.gltf\nFailed to load glTF\nFailed to load vertex buffer\nDraco decoder could not be initialized."
...

It seems that the wasm files are missing (both in dev and build mode) for the @cesium/engine use case

s3xysteak commented 2 months ago

Closed by #11