BarcodeScanner crashes standalone but not on dev

SDK Version: 43
Platforms: ios/android

Hi. I’ve upgrade to expo 43 (from 41) and the barcode scanner (via expo-camera) simply does not scan any QR code (works fine expo client, works fine in —no-dev —minify), can’t test simulator as there is no camera …

But when I build (via EAS), it simply does not scan anything on iOS, whereas on Android, the moment it scans, it instantly crashes.

How do I debug this … ?

Does anyone have any clue how I can debug this?

  • scanner works fine in dev (expo go, as well as in production mode, --no-dev --minify)
  • scanner does not scan anything on iOS (in standalone build, at least it does not crash)
  • camera viewport is showing on Android, but when camera is initiated, it crashes.

I’ve managed to pull the error from Android Vitals (play console).
So, on Android, this is the error: TypeError: undefined is not an object (evaluating ‘P.default.BarCodeType’)

  • the same code works fine on Expo 41 (from where I’ve upgraded)
  • it also works fine via expo build:android

Just when building with EAS, it simply crashes, while on iOS, it does not crash, but it doesn’t scan anything either.

com.facebook.react.common.JavascriptException: TypeError: undefined is not an object (evaluating 'P.default.BarCodeType'), stack:
global code@1120:3
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(
  at java.lang.reflect.Method.invoke (Native Method)
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (
  at (Native Method)
  at android.os.Handler.handleCallback (
  at android.os.Handler.dispatchMessage (
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (
  at android.os.Looper.loop (
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$ (
  at (

I’ve figured it out. Solution is to include expo-barcode-scanner in your package.json.

I think we should do one of the following:

  1. Have EAS account for this automatically, since BarcodeScanner is a dependency
  2. Add a note to the API Reference so that others know they need to install it if they want barcode scan support if the above is not possible
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.