Summary
When using the built-in Expo config plugin with Expo SDK 56, npx expo prebuild fails because the plugin imports from @expo/config-plugins internal paths directly. The package is not hoisted to the project root node_modules, so module resolution fails.
Reproducible sample code
npx expo prebuild --clean
Steps to reproduce
- Create an Expo SDK 56 project (or upgrade an existing one)
- Install react-native-maps:
npx expo install react-native-maps
- Enable the config plugin in
app.config.ts:
import type { ExpoConfig } from 'expo/config';
export default (): ExpoConfig => ({
name: 'repro',
slug: 'repro',
plugins: [
[
'react-native-maps',
{
androidGoogleMapsApiKey: 'test-key',
},
],
],
});
- Run:
npx expo prebuild --clean
Expected result
Prebuild should succeed without requiring @expo/config-plugins as a direct project dependency.
Actual result
Prebuild fails immediately with:
PluginError: Cannot find module '@expo/config-plugins/build/plugins/ios-plugins'
Require stack:
- node_modules/react-native-maps/plugin/build/ios.js
- node_modules/react-native-maps/plugin/build/index.js
- node_modules/react-native-maps/app.plugin.js
React Native Maps Version
1.27.2
What platforms are you seeing the problem on?
Android, iOS (Google Maps)
React Native Version
0.85.3
What version of Expo are you using?
SDK 56
Device(s)
prebuild (Android/iOS)
Additional information
Root cause
The config plugin still uses the legacy import style:
require("@expo/config-plugins/build/plugins/ios-plugins");
require("@expo/config-plugins/build/utils/generateCode");
Since Expo SDK 47, Expo recommends importing from expo/config-plugins instead of @expo/config-plugins directly (SDK 47 blog post). In SDK 56, @expo/config-plugins is nested under expo/node_modules and is not hoisted, so react-native-maps cannot resolve it from its plugin code.
Official Expo modules (e.g. expo-sqlite) already use the new pattern:
import { ConfigPlugin, withGradleProperties } from 'expo/config-plugins';
The same pattern in plugin/src/ios.ts and plugin/src/android.ts would resolve the issue.
Current workaround
Add @expo/config-plugins as a direct dependency:
npx expo install @expo/config-plugins
Summary
When using the built-in Expo config plugin with Expo SDK 56,
npx expo prebuildfails because the plugin imports from@expo/config-pluginsinternal paths directly. The package is not hoisted to the project rootnode_modules, so module resolution fails.Reproducible sample code
Steps to reproduce
app.config.ts:Expected result
Prebuild should succeed without requiring @expo/config-plugins as a direct project dependency.
Actual result
Prebuild fails immediately with:
React Native Maps Version
1.27.2
What platforms are you seeing the problem on?
Android, iOS (Google Maps)
React Native Version
0.85.3
What version of Expo are you using?
SDK 56
Device(s)
prebuild (Android/iOS)
Additional information
Root cause
The config plugin still uses the legacy import style:
Since Expo SDK 47, Expo recommends importing from expo/config-plugins instead of @expo/config-plugins directly (SDK 47 blog post). In SDK 56, @expo/config-plugins is nested under expo/node_modules and is not hoisted, so react-native-maps cannot resolve it from its plugin code.
Official Expo modules (e.g. expo-sqlite) already use the new pattern:
The same pattern in plugin/src/ios.ts and plugin/src/android.ts would resolve the issue.
Current workaround
Add @expo/config-plugins as a direct dependency: