Skip to content

fix: respect wasm load config params when instantiating sqlite (port #24937)#24944

Draft
AztecBot wants to merge 1 commit into
nextfrom
cb/port-24937-to-next
Draft

fix: respect wasm load config params when instantiating sqlite (port #24937)#24944
AztecBot wants to merge 1 commit into
nextfrom
cb/port-24937-to-next

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

Port of #24937 to next.

The cherry-pick conflicted in yarn-project/sqlite3mc-wasm/src/index.ts because next still had the simple sqlite3mc re-export while the source PR replaced it with an init wrapper. I resolved the conflict by using the wrapper from the source PR so locateFile, wasmBinary, and instantiateWasm survive sqlite initialization, while retaining the package's existing exported sqlite types.

origin/port-to-next-staging was not present after repeated fetches, so this PR targets next directly instead of a missing staging base.

Fixes #24895

Tests

  • yarn install --immutable
  • yarn workspace @aztec/foundation build
  • yarn workspace @aztec/sqlite3mc-wasm test src/index.test.ts
  • yarn workspace @aztec/sqlite3mc-wasm build

Full yarn build was attempted, but this fresh checkout lacked generated repo-wide artifacts such as @aztec/l1-artifacts; the narrower sqlite workspace build passed after restoring the required ignored local artifacts for testing.

Closes #24895


Created by claudebox · group: slackbot · Slack thread

The sqlite3mc we vendor clobbers config params used to find the sqlite
wasm file to load.

As a result, the bundler-visible default wasm URL was silently discarded
on the first call in a given env and wasmBinary was never honored at
all.

We introduce an index.ts wrapper that takes care of ensuring options
survive the first call and every call after. It honors `locateFile`,
`wasmBinary`, and `instantiateWasm`, and it defaults to a static
`SQLITE3_WASM_URL` that bundlers rewrite to their emitted asset.

(We need to follow this up with some simplification of aztec-kit)

Closes TRIAGE-200
Fixes #24895
@AztecBot AztecBot added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-no-squash claudebox Owned by claudebox. it can push to this PR. labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-no-squash claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlite3mc-wasm: first sqlite3InitModule() call ignores bundler-friendly locateFile override, reintroducing #24529's 404

2 participants