-
Notifications
You must be signed in to change notification settings - Fork 230
Description
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.jsfile, or - Not export
AppleButtonif 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/[email protected] - 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.jsAppleButton.android.jsAppleButton.macos.jsAppleButton.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.jsfile 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(notAppleButton) are still affected - Looking for help with a proper solution