Skip to content

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

Merged
mverzilli merged 1 commit into
nextfrom
cb/port-24937-to-next
Jul 24, 2026
Merged

fix: respect wasm load config params when instantiating sqlite (port #24937)#24944
mverzilli merged 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
@mverzilli
mverzilli marked this pull request as ready for review July 24, 2026 08:27
@mverzilli
mverzilli enabled auto-merge July 24, 2026 08:28
@mverzilli
mverzilli added this pull request to the merge queue Jul 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 24, 2026
@mverzilli
mverzilli added this pull request to the merge queue Jul 24, 2026
Merged via the queue into next with commit a4e87e4 Jul 24, 2026
61 of 65 checks passed
@mverzilli
mverzilli deleted the cb/port-24937-to-next branch July 24, 2026 10:25
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