Fix: expo-sqlite wa-sqlite.wasm Unable to Resolve Module
Fix `Unable to resolve module wa-sqlite.wasm` errors in Expo SQLite by updating Metro config for WASM assets and package exports. Includes cache, package, import path, Expo Go, iOS pods, and SDK mismatch fixes.
On this page
If you're using `expo-sqlite` on Expo SDK 52 or later, you may have hit this exact red screen: `Unable to resolve module '.../wa-sqlite/dist/wa-sqlite-async.wasm'` — or a similar error naming `wa-sqlite.wasm`. This is different from the generic `Unable to resolve module 'xyz'` error most React Native guides cover, because the cause here is specific to how `expo-sqlite` ships its web/WASM build. This guide fixes that exact error first, then covers the other 8 causes of the generic version of this error in case yours has a different root cause.
Cause 0: wa-sqlite.wasm Not Resolved (expo-sqlite on SDK 52+)
Starting with newer Expo SDK versions, `expo-sqlite` supports web through a WebAssembly SQLite build. Expo's documentation says web usage requires Metro support for `.wasm` files and HTTP headers for `SharedArrayBuffer`. The `wa-sqlite.wasm` resolver error happens when Metro cannot treat the WASM file as an asset, or when a custom/older Metro config does not resolve the package's conditional exports correctly. In current Metro versions, package exports are enabled by default, but older projects or copied configs may still disable them.
After saving `metro.config.js`, clear the Metro cache and restart — a stale cache will keep serving the old resolver behavior even after this fix.
If you're targeting web and module resolution succeeds but SQLite fails at runtime, check `SharedArrayBuffer` support. Expo's docs require `Cross-Origin-Embedder-Policy` and `Cross-Origin-Opener-Policy` headers for deployed web builds. That is a separate runtime issue from `Unable to resolve module` during bundling.
If the exact same error remains after updating `metro.config.js`, check that `expo`, `expo-sqlite`, React Native, and Metro are aligned with your Expo SDK. Run `npx expo install --check` and `npx expo-doctor` before changing code again.
Still Stuck? Other Causes of 'Unable to Resolve Module'
If the fix above didn't apply to your case, or you're seeing this error for a package other than expo-sqlite, the cause is likely one of the following eight — all common across React Native and Expo projects.
Cause 1: Stale Metro Cache (Most Common)
Metro caches transformed modules locally for speed. After you install a new package, add a file, or change a config, Metro sometimes keeps serving the old cached state and cannot resolve the new module even though it is physically present in `node_modules`. This is the most common cause of this error and the fix takes five seconds.
If the error persists after clearing the cache, move on to the next cause — the cache was not the issue.
Cause 2: Package Not Installed
The most obvious cause — you are importing a package that is not in your `node_modules`. This happens when you copy code from documentation, a tutorial, or an AI tool without installing the dependency first. Check the exact module name in the error and install it.
For Expo projects specifically, always use `npx expo install` instead of plain `npm install`. The Expo CLI picks the exact version compatible with your installed SDK, which prevents a whole class of follow-up version mismatch errors.
Cause 3: Wrong Import Path (Typo or Case Mismatch)
If you are importing a local file (not a package), a wrong path or file name case mismatch will trigger this error. macOS is case-insensitive but Linux (used by CI and EAS Build) is case-sensitive — so a file named `Button.tsx` imported as `button.tsx` works on your Mac but fails in production builds.
Cause 4: Wrong Import Syntax or Wrong Entry Point
A default-vs-named import mistake usually does not mean Metro failed to find the file. It normally produces an undefined export or runtime/component error. Still, it is worth checking import syntax when the named module resolves but your app fails immediately after bundling.
Cause 5: Native Module Not Included in Expo Go
Some libraries that ship custom native code cannot run inside Expo Go because Expo Go contains only a fixed set of native modules. This is not the cause of the `wa-sqlite.wasm` web resolver error, and `expo-sqlite` itself is listed as included in Expo Go. But if your error is `Cannot find native module ...`, or you enabled native-only options such as SQLCipher, switch to a development build.
Cause 6: node_modules Corrupted or Out of Sync
Sometimes `node_modules` gets into a broken state after a failed install, a git pull that changed `package.json`, or switching branches. A full clean reinstall fixes this.
Cause 7: iOS Pods Not Installed After Adding a Package
In bare React Native projects on iOS, installing a native package with `npm install` is not enough — CocoaPods must also be updated to link the native side. In Expo prebuild/dev-client projects, rerun prebuild or build a fresh development client after adding native modules or changing config plugins.
Cause 8: Expo SDK Version Mismatch
If you installed a package with plain `npm install` in an Expo project, it may pull a version incompatible with your SDK. This causes Metro to resolve the module but then fail to run it. Always use `npx expo install` and run the version check regularly.
Quick Diagnosis Checklist
- Using expo-sqlite and the error names wa-sqlite.wasm? Update metro.config.js first (see Cause 0 above).
- Clear Metro cache — `npx expo start --clear`. If it fixes it, you are done.
- Check the module name in the error — is it a package or a local file path? If it is a package, confirm it is in your `package.json` and `node_modules`.
- If the package exists but error persists — delete `node_modules` and reinstall cleanly.
- If it is a local file — verify the exact filename, folder structure, and casing matches your import.
- If you just added a native library and are on Expo Go — switch to a development build.
- If you are on iOS bare workflow — run `pod install` inside the `ios/` folder.
- Run `npx expo-doctor` — it catches version mismatches and missing peer dependencies automatically.
Official-Style Error Explanation
Exact error target: `Unable to resolve module 'wa-sqlite/dist/wa-sqlite-async.wasm'` or `Unable to resolve module 'wa-sqlite.wasm'`. In an Expo SQLite web build, this means Metro cannot bundle the WebAssembly SQLite file. Fix it by adding `wasm` to `resolver.assetExts`, ensuring package exports are not disabled, and restarting Metro with a cleared cache. For generic `Unable to resolve module 'xyz' from '/path/to/file.tsx'` errors, check stale cache, missing packages, wrong local paths, filename casing, Expo Go native-module limits, corrupted `node_modules`, iOS pods, and Expo SDK version mismatches.
FAQ
Why does expo-sqlite throw an error about wa-sqlite.wasm specifically?
Expo SQLite's web build uses a WebAssembly SQLite file. Metro must be configured to handle `.wasm` assets, and package exports must not be disabled. Without that, Metro may fail during bundling with `Unable to resolve module 'wa-sqlite/dist/wa-sqlite-async.wasm'` or `Unable to resolve module 'wa-sqlite.wasm'`.
The package is in node_modules but I still get the error — why?
Metro is almost certainly serving a stale cached version that does not know about the newly installed package. Run `npx expo start --clear` or `npx react-native start --reset-cache` to force Metro to rebuild its module graph from scratch.
The error only happens in my EAS Build / CI but not locally — why?
This is almost always a filename case mismatch. Your local macOS filesystem is case-insensitive, so `import Button from './button'` resolves `Button.tsx` without error. Linux (used by EAS Build and most CI environments) is case-sensitive and rejects the wrong casing. Fix your import to exactly match the filename.
How do I know if a library needs a Development Build vs working in Expo Go?
Check the library's Expo compatibility notes. Libraries that require custom native code, config plugins, native installation steps, or native options not bundled in Expo Go require a development build. `expo-sqlite` itself is included in Expo Go, but options such as SQLCipher require a custom build.
I deleted node_modules and reinstalled but still get the error — what next?
Clear everything: delete node_modules, package-lock.json, the .expo folder, and the Metro cache temp files, then reinstall. On macOS: `rm -rf node_modules .expo && npm cache clean --force && npm install && npx expo start --clear`. If it still fails, run `npx expo-doctor` to identify any dependency conflicts or incompatible versions.
Shahmeer Rizwan
Full-Stack Developer