diff --git a/.changeset/tender-parks-change.md b/.changeset/tender-parks-change.md new file mode 100644 index 0000000000000..67918ae82e538 --- /dev/null +++ b/.changeset/tender-parks-change.md @@ -0,0 +1,6 @@ +--- +"@gradio/wasm": patch +"gradio": patch +--- + +feat:Fix the Wasm worker to initialize the app directories diff --git a/js/wasm/src/webworker/index.ts b/js/wasm/src/webworker/index.ts index f2df39a6ecedb..de6679591c064 100644 --- a/js/wasm/src/webworker/index.ts +++ b/js/wasm/src/webworker/index.ts @@ -187,6 +187,13 @@ async function initializeApp( options: InMessageInitApp["data"], updateProgress: (log: string) => void ): Promise { + const appHomeDir = getAppHomeDir(appId); + console.debug("Creating a home directory for the app.", { + appId, + appHomeDir + }); + pyodide.FS.mkdir(appHomeDir); + console.debug("Mounting files.", options.files); updateProgress("Mounting files"); await Promise.all( @@ -249,6 +256,8 @@ function setupMessageHandler(receiver: MessageTransceiver): void { // This multi-app mechanism was introduced for a SharedWorker, but the same mechanism is used for a DedicatedWorker as well. const appId = generateRandomString(8); + console.debug("Set up a new app.", { appId }); + const updateProgress = (log: string): void => { const message: OutMessage = { type: "progress-update",