Description
The @invertase/react-native-apple-authentication package exports AppleButton from ./AppleButton in its index.js file, but the AppleButton.js file doesn't exist in the package. This causes build failures in EAS Build environments.
Error Message
Unable to resolve module ./AppleButton from /Users/expo/workingdir/build/node_modules/@invertase/react-native-apple-authentication/lib/index.js:
None of these files exist:
* node_modules/@invertase/react-native-apple-authentication/lib/AppleButton(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.mjs|.mjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
* node_modules/@invertase/react-native-apple-authentication/lib/AppleButton
22 |
23 |
> 24 | export { default as AppleButton } from './AppleButton';
| ^
25 |
26 | /**
27 | * iOS
Expected Behavior
The package should either:
- Include the missing
AppleButton.js file, or
- Not export
AppleButton if it's not available
Actual Behavior
The package tries to export AppleButton from a non-existent file, causing Metro bundler to fail during the build process.
Environment
- Package Version:
@invertase/react-native-apple-authentication@2.4.1
- Platform: iOS (EAS Build)
- Build Environment: EAS Build (Expo Application Services)
- Metro Version: Latest (via Expo SDK 52)
Investigation
The package contains platform-specific AppleButton files:
AppleButton.ios.js
AppleButton.android.js
AppleButton.macos.js
AppleButton.shared.js
But it's missing the generic AppleButton.js file that the main index.js tries to import.
Suggested Fix
The package should either:
-
Option A: Create a generic AppleButton.js file that exports the appropriate platform-specific component:
// AppleButton.js
import { Platform } from 'react-native';
const AppleButton = Platform.select({
ios: require('./AppleButton.ios.js').default,
android: require('./AppleButton.android.js').default,
macos: require('./AppleButton.macos.js').default,
default: require('./AppleButton.shared.js').default,
});
export default AppleButton;
-
Option B: Remove the AppleButton export from the main index.js if it's not meant to be used:
// Comment out or remove this line from index.js
// export { default as AppleButton } from './AppleButton';
Impact
This issue affects any project using this package in EAS Build environments, even if they're not using the AppleButton component (only using appleAuth).
Additional Context
- The issue only occurs in EAS Build, not in local development
- Projects that only use
appleAuth (not AppleButton) are still affected
- Looking for help with a proper solution
Description
The
@invertase/react-native-apple-authenticationpackage exportsAppleButtonfrom./AppleButtonin itsindex.jsfile, but theAppleButton.jsfile doesn't exist in the package. This causes build failures in EAS Build environments.Error Message
Expected Behavior
The package should either:
AppleButton.jsfile, orAppleButtonif it's not availableActual Behavior
The package tries to export
AppleButtonfrom a non-existent file, causing Metro bundler to fail during the build process.Environment
@invertase/react-native-apple-authentication@2.4.1Investigation
The package contains platform-specific AppleButton files:
AppleButton.ios.jsAppleButton.android.jsAppleButton.macos.jsAppleButton.shared.jsBut it's missing the generic
AppleButton.jsfile that the mainindex.jstries to import.Suggested Fix
The package should either:
Option A: Create a generic
AppleButton.jsfile that exports the appropriate platform-specific component:Option B: Remove the AppleButton export from the main index.js if it's not meant to be used:
Impact
This issue affects any project using this package in EAS Build environments, even if they're not using the AppleButton component (only using
appleAuth).Additional Context
appleAuth(notAppleButton) are still affected