You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OPFSCoopSyncVFS: NoModificationAllowedError on page reload after manual browser storage clear in chrome #296
It seems like when we manually clear browser storage in google chrome the access handles aren't released properly (probably because files are gone before VFS's jClose has a chance?) so when we reload after clearing it gets stuck in the 'NoModificationAllowedError' only fully closing google chrome and reopening it fixes it. On firefox v144.0 this doesn't happen or I'm unable to produce it but here are the steps to reproduce it in the demo link in chrome using the OPFSCoopSyncVFS.
Click on the Execute button in demo once which should return some rows
Now click on the chrome's URL information menu (View Site Information) and Click "Site Settings" and then click "Delete Data" under usage.
Close this settings tab and go back to the demo link and hit reload.
If we have the &reset query it gives this error:
NoModificationAllowedError: Failed to execute 'removeEntry' on 'FileSystemDirectoryHandle': An attempt was made to modify an object where modifications are not allowed.
And without the &reset the error is always this:
NoModificationAllowedError: Failed to execute 'createSyncAccessHandle' on 'FileSystemFileHandle': Access Handles cannot be created if there is another open Access Handle or Writable stream associated with the same file.
Error: sqlite3_open_v2
at check (https://rhashimoto.github.io/wa-sqlite/src/sqlite-api.js:864:11)
at Object.open_v2 (https://rhashimoto.github.io/wa-sqlite/src/sqlite-api.js:498:9)
at async https://rhashimoto.github.io/wa-sqlite/demo/demo-worker.js?build=asyncify&config=OPFSCoopSyncVFS:98:14
Close the browser and reopen to see error gone.
I was testing this path for an easy "reboot" like "Just clear your browser storage and reload" if user's db is corrupted due to app level mishandling or is not migrated properly etc so they can easily just clear their browser storage and resume from a fresh state.
Environment
Google Chrome v141.0.7390.108
wa-sqlite v1.0.9 (VFS: OPFSCoopSyncVFS)
@lumosminima What platform are you on? I'm using the same version of Chrome, but I can't reproduce the error. I'm on an Apple M2 mini running macos 15.6.1 (Sequoia).
I understand your motivation, and it's a good one, but I'm not sure this falls within my responsibility or even under my control.
@rhashimoto I'm running on Windows 11 25H2 (OS Build 26200.6899). I understand since there is no "beforeStorageClear" event which could probably be used to properly close the db and release handles when files are not yet cleared. I wasn't sure but I guess this is a chrome specific limitation on windows and not a bug in wa-sqlite so I will just catch this error and direct user to restart their browser in case this path is ever taken by user.
Activity
rhashimoto commentedon Oct 20, 2025
@lumosminima What platform are you on? I'm using the same version of Chrome, but I can't reproduce the error. I'm on an Apple M2 mini running macos 15.6.1 (Sequoia).
I understand your motivation, and it's a good one, but I'm not sure this falls within my responsibility or even under my control.
lumosminima commentedon Oct 21, 2025
@rhashimoto I'm running on Windows 11 25H2 (OS Build 26200.6899). I understand since there is no "beforeStorageClear" event which could probably be used to properly close the db and release handles when files are not yet cleared. I wasn't sure but I guess this is a chrome specific limitation on windows and not a bug in wa-sqlite so I will just catch this error and direct user to restart their browser in case this path is ever taken by user.
EDIT: I've opened an issue on chromium regarding this: https://issues.chromium.org/issues/453704691