From 0897e3aec1dcc66925e30cc58ff83fea97e2289b Mon Sep 17 00:00:00 2001 From: Kevin Zakka Date: Wed, 3 Jun 2026 08:22:49 -0700 Subject: [PATCH] Skip the prefetcher when the URL scheme isn't fetchable. Drag-and-drop uploads go through Module.loadFile and never reached the prefetcher. This is a guard for future provider schemes (e.g., vfs) that shouldn't be passed to fetch(). PiperOrigin-RevId: 926042158 Change-Id: I119d5b1a7512f8e84bb4c752414797593a1e98cd --- src/experimental/studio/live.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/experimental/studio/live.js b/src/experimental/studio/live.js index 13bd874f..e5f51fff 100644 --- a/src/experimental/studio/live.js +++ b/src/experimental/studio/live.js @@ -50,6 +50,14 @@ function resolveScheme(url) { } async function prefetchModelAssets(rootUrl, onProgress) { + // Only prefetch when the root URL is one we know how to fetch from + // Javascript. Other resource-provider-backed schemes (e.g., uploaded files + // via the drag-and-drop path) skip the prefetcher entirely and let + // Module.loadUrl handle take the existing slow path. + if (!/^(https?:|github:)/.test(rootUrl)) { + return { files: 0, bytes: 0, errors: 0 }; + } + const primed = new Set(); // URLs we've already pushed into FetchCache const stats = { files: 0, bytes: 0, errors: 0 };