Property 'createSyncAccessHandle' does not exist on type 'FileSystemFileHandle'.ts(2339)
const root = await navigator.storage.getDirectory();
const File1 = await root.getFileHandle('file.txt', { create: true });
const accessHandle = await File1.createSyncAccessHandle();
Based on the docs we have createSyncAccessHandle method but is not found, whether I am missing something

The docs state:
The createSyncAccessHandle() method of the FileSystemFileHandle interface returns a Promise which resolves to a FileSystemSyncAccessHandle object that can be used to synchronously read from and write to a file. The synchronous nature of this method brings performance advantages, but it is only usable inside dedicated Web Workers for files within the origin private file system.
So my question is, are you runnning this inside a Web Worker?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With