Expo Go: “new NativeEventEmitter() requires a non-null argument” or “doesn't seem to be linked”
These errors mean the JavaScript asked for a native module the running app binary doesn't contain. The usual reason is running in Expo Go, which can't load native code it doesn't ship with, and in-app purchase libraries need native code. Make a development build (npx expo run:ios / run:android, or EAS Build) and open the app from that. If you're already on one, rebuild it after adding the package.
Symptom
- The app crashes on start, or when the purchase screen opens, with:
Invariant Violation: new NativeEventEmitter() requires a non-null argument.
- Or a red screen saying the package doesn't seem to be linked, with a checklist that ends “You are not using Expo Go”.
- Or calls into the package fail with a “not available” or “not linked” error instead of crashing.
- It started right after installing an in-app purchase, push, auth or analytics package.
Why it happens
A React Native package with native code has two halves: JavaScript in node_modules, and Swift or Kotlin compiled into the app binary. Installing the package updates the JavaScript straight away. The native half only exists after you build the app again.
Expo Go is a prebuilt app from the stores. It contains the Expo SDK's own modules and nothing else, so for any other native package the native half is missing (null). new NativeEventEmitter(null) throws, and packages that check first report that they aren't linked.
| Cause | How to tell |
|---|---|
| Running in Expo Go | You opened the project from the Expo Go app by scanning a QR code |
| Development build older than the package | You built the dev client before adding or upgrading the package |
| Native project not regenerated | You use Continuous Native Generation and haven't run prebuild since adding a config plugin |
| iOS pods not installed (bare React Native) | pod install wasn't run after npm install |
Confirm it
- Look at which app is open on the device. If it's Expo Go (the generic Expo app, not your own icon), that's the cause.
- On recent Expo SDKs, log the exact check:
import { isRunningInExpoGo } from "expo";
console.log("Expo Go:", isRunningInExpoGo());
Don't use Constants.executionEnvironment === "storeClient": it's also true in development builds.
- If you're in your own development build, compare dates: was it built after you installed the package? If not, it's stale.
Fix
- Install the dev client:
npx expo install expo-dev-client
- Build your own app, locally:
npx expo run:ios
npx expo run:android
Add --device to install on a connected phone. Or build in the cloud with EAS:
eas build --profile development --platform ios
- Start the bundler with
npx expo startand open the project in your app, not Expo Go. - After adding or upgrading any native package, regenerate and rebuild:
npx expo prebuild --clean
npx expo run:ios
- Bare React Native: run
cd ios && pod install, then rebuild from Xcode ornpx react-native run-ios.
To keep using Expo Go for UI work, guard native calls behind isRunningInExpoGo() and show a placeholder there. Test purchases only in the development build.
Stop it coming back
- Once a project has a native package, make the development build the default way to run it, and say so in the README.
- Rebuild the dev client whenever
package.jsongains or upgrades a native package. A JavaScript reload never picks up native code. - In CI, build the dev client after dependency changes, so a stale binary is never the one people test on.
If you use BillDog
@billdog.io/expo is built not to crash in Expo Go. Importing it and calling configure are safe there, and every native event emitter is created only when its native module exists. Calls that need native code fail cleanly instead. For example, BillDog.purchase() returns { type: "failed" } with the error code NATIVE_MODULE_UNAVAILABLE, and a message telling you to use a development build.
The package's config plugin (in app.json → plugins) adds the iOS pod and raises the iOS deployment target to 15.0 when you run prebuild. The package also exports isExpoGo(). To show a paywall inside Expo Go, use WebViewPaywall. This was checked against the source of the published SDK 1.1.1-beta.5. It hasn't yet been reproduced on a device for this page.
Related
Sources
Did this fix it?
Frequently asked questions
Can I test in-app purchases in Expo Go at all?
No. Expo Go ships a fixed set of native modules, and no in-app purchase library is one of them. Purchases need a development build, which is your own app binary with your native packages compiled in.
Do I need an Expo account or EAS to make a development build?
No. npx expo run:ios and npx expo run:android build on your own machine with Xcode or Android Studio. EAS Build is the cloud option, useful if you don't have a Mac for iOS.
Is executionEnvironment === 'storeClient' a reliable Expo Go check?
No. Expo documents StoreClient as covering both Expo Go and development builds made with expo-dev-client, where native modules do work. Recent Expo SDKs export isRunningInExpoGo() from the expo package for an exact check.
I made a development build and still get the error. Why?
The installed build is older than the package. Native code only changes when you rebuild, so after adding or upgrading a native package run npx expo prebuild --clean and build again. A JavaScript reload isn't enough.