Skip to content

[WASM] Saving through the download fallback throws TypeError: handle.createWritable is not a function on Safari 15.2 to 18 #25683

Open

Description

@mikernet

Current behavior 🐛

On Safari 15.2 to 18 (iOS 15.2 to 18, and macOS), saving a file with FileSavePicker through the download fallback fails. PickSaveFileAsync returns a file, but CachedFileManager.CompleteUpdatesAsync throws:

TypeError: handle.createWritable is not a function. (In 'handle.createWritable()', 'handle.createWritable' is undefined)

The download picker stages the file in the origin-private file system (OPFS) before it starts the download (#23880). It falls back to an in-memory Blob only when navigator.storage.getDirectory() is missing or fails. Safari 15.2 to 18 has getDirectory(), but FileSystemFileHandle.createWritable only arrived in Safari 26 ("Added support for the File System WritableStream API"). So the staging fails, and no file is saved.

This is the iOS 16 failure noted in #24130. iOS 17 and 18 are affected the same way.

Expected behavior 🎯

Saving works on Safari 15.2 to 18, with the download built in memory as it is in browsers without an origin-private file system.

How to reproduce it (as minimally and precisely as possible) 🔬

In a WebAssembly app with the default WasmPickerConfiguration.FileSystemAccessApiWithFallback, served over HTTPS or from localhost, run in Safari 15.2 to 18:

var picker = new FileSavePicker { SuggestedFileName = "Report" };
picker.FileTypeChoices.Add("Text", new List<string> { ".txt" });

var file = await picker.PickSaveFileAsync();
CachedFileManager.DeferUpdates(file);
await FileIO.WriteTextAsync(file, "Hello, world!");
await CachedFileManager.CompleteUpdatesAsync(file); // throws the TypeError

The same happens in Safari 26 or Chrome after delete FileSystemFileHandle.prototype.createWritable, which is how I reproduced it in the iOS 26.0 and 27.0 simulators and in Chrome.

Workaround 🛠️

No response

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

WebAssembly

Uno.Sdk version (and other relevant versions) 📦

Reproduced in the SamplesApp built from master (ab14387) and from 6.8.0-dev.222 (Uno.Sdk 6.8.0-dev.66). The staging has been there since #23880, so Uno.Sdk 6.7.0-dev.165 from #24130 has it too.

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

I'll open a PR that also fixes #24130.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions