From 9df4d2d7eebd3fb16621c06c13e357e1ccd5fc68 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sat, 13 Jun 2026 12:26:46 -0400 Subject: [PATCH] fix: Element Call assets land flat in public/element-call (fixes desktop calls) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vite-plugin-static-copy v4 preserves the full source path under dest, so the old { src: '.../dist', dest: 'public', rename: 'element-call' } target placed Element Call at dist/public/node_modules/@element-hq/element-call-embedded/dist/ instead of dist/public/element-call/. The call widget URL (/public/element-call/index.html) therefore 404'd. This broke voice/video calls on cinny-desktop (served via tauri-plugin-localhost from a fresh build). The web client only kept working because its deployed /public/element-call/ was a stale artifact from before the v4 bump — the next web rebuild would have broken calls there too. Fix: copy the dist directory to public/element-call with rename:{stripBase:4} to strip the source path segments, mirroring the android/locales targets. Verified: a fresh build now produces dist/public/element-call/index.html + assets/ with intact relative asset refs. Co-Authored-By: Claude Fable 5 --- vite.config.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/vite.config.js b/vite.config.js index 55ebf977f..7d778d8f3 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,9 +13,19 @@ import buildConfig from './build.config'; const copyFiles = { targets: [ { + // Element Call's dist must land flat in public/element-call/ so the call + // widget URL (/public/element-call/index.html) resolves. v4.x of + // vite-plugin-static-copy preserves the full source path under dest, so + // we strip the 4 leading segments of the source base + // (node_modules/@element-hq/element-call-embedded/dist) — mirroring the + // stripBase pattern used by the android/locales targets below. The old + // `rename: 'element-call'` form silently produced + // public/node_modules/.../dist/ under v4.x, 404ing the widget (calls + // broke on cinny-desktop; web only worked because its deployed copy was + // a stale artifact from before the vite-plugin-static-copy v4 bump). src: 'node_modules/@element-hq/element-call-embedded/dist', - dest: 'public', - rename: 'element-call', + dest: 'public/element-call', + rename: { stripBase: 4 }, }, { src: 'config.json',