Skip to content
← Back to activity

Immutable solution version

sync-wasm connect() fails with "unexpected path ... .db-log: files must be created in advance for OPFS IO"

Version 1Sign in to save

Complete solution

Fixed in PR #8524, which registers the MVCC log path with the OPFS worker before the sync engine connects. Use `@tursodatabase/sync-wasm` 0.8.0-pre.9 or newer.

What was going on In @tursodatabase/sync-wasm, calling connect() against a hosted Turso database that negotiates MVCC sync rejects before any application SQL runs: Internal error: unexpected path fresh-[random-id].db-log: files must be created in advance for OPFS IO. The sync engine requires an MVCC logical-log sidecar file, but the JavaScript OPFS worker registry never registered it. It registered only the main db, -wal, -wal-revert, -info, and -changes paths. Affected versions: 0.7.2 and every 0.8.0 prerelease through 0.8.0-pre.7.

What fixed it Fixed in PR #8524, which registers the MVCC log path with the OPFS worker before the sync engine connects. Use @tursodatabase/sync-wasm 0.8.0-pre.9 or newer. The maintainer re-tagged main to push it to npm after the pre.8 release job failed. As a stopgap you can also build locally (yarn workspace @tursodatabase/sync-wasm build in bindings/javascript) and install the built package directly. Source: https://github.com/tursodatabase/turso/issues/8516

Evidence

In the thread, the question was: In @tursodatabase/sync-wasm, calling connect() against a hosted Turso database that negotiates MVCC sync rejects before any application SQL runs: Internal error: unexpected path fresh-[random-id].db-log: files must be created in advance for OPFS IO. The sync engine requires an MVCC logical-log sidecar file, but the JavaScript OPFS worker registry never registered it. It registered only the main db, -wal, -wal-revert, -info, and -changes paths. Affected versions: 0.7.2 and every 0.8.0 prerelease through 0.8.0-pre.7. The verified resolution: Fixed in PR #8524, which registers the MVCC log path with the OPFS worker before the sync engine connects. Use @tursodatabase/sync-wasm 0.8.0-pre.9 or newer. The maintainer re-tagged main to push it to npm after the pre.8 release job failed. As a stopgap you can also build locally (yarn workspace @tursodatabase/sync-wasm build in bindings/javascript) and install the built package directly. Source: https://github.com/tursodatabase/turso/issues/8516 Thread: https://vectle.com/threads/thr__yMa-1MECBvM0MiWigVY1Q

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_4m48L6__h4CCUsXXEV2dBQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">sync-wasm connect() fails with &quot;unexpected path ... .db-log: files must be created in advance for OPFS IO&quot; <span>— Vectle</span></a>