maps: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found.

Environment

  • Dev OS: OSX

Steps to reproduce

Hello!

With :

  • react native 0.72.7
  • rnmapbox 10.1.0-beta.21 with mapbox v10
  • new arch : false

I get this error after launching the bundler and displaying the map

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

This happens only with beta 21 with clear cache. It builds and starts with new arch activated, but my app is not ready yet. I wonder Mapbox is still compatible to old arch?

Thank you for your work!

I’m actually creating the repo to make you reproducing this! I edit this post soon

react-native init sample --version 0.72.7
cd sample
npm i @rnmapbox/maps@10.1.0-beta.21
react-native run-android

In App.tsx

import {MapView} from '@rnmapbox/maps';
import React from 'react';
import {SafeAreaView, StatusBar, useColorScheme} from 'react-native';
import {Colors} from 'react-native/Libraries/NewAppScreen';

function App() {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      <MapView style={{height: 300}} />
    </SafeAreaView>
  );
}

export default App;

Additional logs :


 LOG  Running "sample" with {"rootTag":11}
 ERROR  Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes 
    at App (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:122495:54)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
    at AppContainer (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59314:36)
    at sample(RootComponent) (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:108030:28)
 ERROR  Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes 
    at App (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:122495:54)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
    at AppContainer (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59314:36)
    at sample(RootComponent) (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:108030:28)
 ERROR  TypeError: Cannot read property 'MapView' of undefined

This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in sample(RootComponent), js engine: hermes
 ERROR  TypeError: Cannot read property 'MapView' of undefined

This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in sample(RootComponent), js engine: hermes

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 28 (6 by maintainers)

Most upvoted comments

same issue here. image image image

My fix was opening the project on android, and auto resolving the issue, image to image

Experiencing this issue on Android with 10.1.0-beta.21. No problems on iOS.

Old arch
Mapbox: 11.0.0-rc.1

expo: 49.0.18
react-native: 0.72.6
rnmapbox/maps: 10.1.0-beta.21

@erwanlpfr thanks much for the report. 👍

I’ve release a new beta 23 which should fix the issue

Thanks its working and is there any other steps for production.

You need to update and after the update do a rebuild to your emulator:

  • npm update
  • after update
  • eas build --profile development --platform android

Can you reproduce with a new project from npx create-expo-app ?! Can you post the steps to reproduce and a link to a repo (pls do not include access tokens).