-
Notifications
You must be signed in to change notification settings - Fork 70
Description
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed.
- I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers.
Bug summary
Bug: Expo prebuild fails — “Cannot find module './lib/commonjs/expo'”
Description
When adding the react-native-bottom-tabs plugin to the Expo config (plugins array in app.config.ts), the expo prebuild command fails with the following error:
Error: Cannot find module './lib/commonjs/expo'
Require stack:
- node_modules/react-native-bottom-tabs/app.plugin.js
...
After inspecting node_modules/react-native-bottom-tabs, it seems the published package on npm is missing the compiled lib/commonjs/expo directory, which app.plugin.js tries to require.
📦 Investigation
Inside node_modules/react-native-bottom-tabs, the file app.plugin.js contains:
module.exports = require('./lib/commonjs/expo');
However, the package does not include a lib/commonjs directory — it appears the CommonJS build artifacts were not published to npm.
This causes Expo’s config plugin resolver to crash when running expo prebuild.
💡 Expected Behavior
expo prebuild should resolve the app.plugin.js normally and complete without errors.
The package should include the built /lib/commonjs/expo.js file in the npm tarball.
Library version
1.0.0
Environment info
- react-native-bottom-tabs version: 1.0.0
- Expo SDK: 53
- Node: 22
- OS: macOS
- Prebuild command: npx expo prebuildSteps to reproduce
-
Install the package:
npm install react-native-bottom-tabs
-
Add it to your app.config.ts:
plugins: [
'react-native-bottom-tabs',
// other plugins...
], -
Run:
npx expo prebuild
-
Observe the error:
Error: Cannot find module './lib/commonjs/expo'
Reproducible sample code
Using react-native-bottom-tabs as an Expo config plugin causes the prebuild process to crash because the published package is missing its compiled CommonJS output.
Error output
Error: Cannot find module './lib/commonjs/expo'
Require stack:
- node_modules/react-native-bottom-tabs/app.plugin.js
- @expo/config-plugins/build/utils/plugin-resolver.js
- @expo/cli/build/src/prebuild/prebuildAsync.js
...
Opening the installed package confirms that the lib/commonjs/expo.js file doesn’t exist, even though it’s required by app.plugin.js.
cmd: ls node_modules/react-native-bottom-tabs/lib/commonjs
ls: node_modules/react-native-bottom-tabs/lib/commonjs: No such file or directory