fix(expo-app): patch hoisted deps and add libsodium-wrappers ESM shim#467
Merged
leeroybrun merged 1 commit intoslopus:mainfrom Jan 24, 2026
Merged
Conversation
Expo web builds can fail at runtime with:
"Unable to resolve module ./libsodium.mjs from .../libsodium-wrappers.mjs"
Root cause:
- In Yarn workspace installs, libsodium-wrappers is typically hoisted to the repo root.
- Upstream postinstall runs `patch-package` from `expo-app/`, so patches cannot apply to hoisted deps.
- libsodium-wrappers@0.7.16's ESM wrapper imports `./libsodium.mjs`, but that file is not shipped.
Fix:
- Add `expo-app/patches/libsodium-wrappers+0.7.16.patch` to provide the missing ESM shim:
`dist/modules-esm/libsodium.mjs` -> `export { default } from "libsodium";`
- Replace the naive postinstall with `expo-app/tools/postinstall.mjs` that:
- resolves real paths (works when executed via symlinked workspace paths)
- runs patch-package from the repo root with `--patch-dir expo-app/patches` so hoisted deps are patched
- keeps the existing `setup-skia-web public` step
This makes the Expo web UI load reliably in clean environments (including Linux VMs).
JoeLuker
pushed a commit
to JoeLuker/happy
that referenced
this pull request
Feb 1, 2026
…-wrappers-web fix(expo-app): patch hoisted deps and add libsodium-wrappers ESM shim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expo web builds can fail at runtime with:
"Unable to resolve module ./libsodium.mjs from .../libsodium-wrappers.mjs"
Root cause:
patch-packagefromexpo-app/, so patches cannot apply to hoisted deps../libsodium.mjs, but that file is not shipped.Fix:
expo-app/patches/libsodium-wrappers+0.7.16.patchto provide the missing ESM shim:dist/modules-esm/libsodium.mjs->export { default } from "libsodium";expo-app/tools/postinstall.mjsthat:--patch-dir expo-app/patchesso hoisted deps are patchedsetup-skia-web publicstepThis makes the Expo web UI build and load again with the monorepo