diff --git a/src/experimental/platform/model_holder.cc b/src/experimental/platform/model_holder.cc index 78bbc4cc..52652eaa 100644 --- a/src/experimental/platform/model_holder.cc +++ b/src/experimental/platform/model_holder.cc @@ -80,6 +80,10 @@ ModelHolder::~ModelHolder() { void ModelHolder::PostInit() { if (spec_ && !model_) { +#ifdef __EMSCRIPTEN__ + // Disable threaded compilation on WASM since pthreads are not available. + spec_->compiler.usethread = 0; +#endif model_ = mj_compile(spec_, &vfs_); if (!model_) { SetLoadError(mjs_getError(spec_)); diff --git a/src/experimental/studio/index.html b/src/experimental/studio/index.html index ee22448d..9a98df67 100644 --- a/src/experimental/studio/index.html +++ b/src/experimental/studio/index.html @@ -97,9 +97,9 @@ console.error('Failed to prefetch one or more assets.', error); }); }, - animate: () => { + animate: async () => { try { - Module.renderFrame(); + await Module.renderFrame(); } catch (error) { console.error('Update error:', error); }