Skip to content

Config plugin fails on Expo SDK 56: Cannot find module '@expo/config-plugins/build/plugins/ios-plugins' #5927

@tikitorchey

Description

@tikitorchey

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

  1. Create an Expo SDK 56 project (or upgrade an existing one)
  2. Install react-native-maps:
npx expo install react-native-maps
  1. 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',
      },
    ],
  ],
  });
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions