Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #375
Fixes #364
Why
lib/index.jsalways doesexport { default as AppleButton } from './AppleButton', but the published package only shippedAppleButton.ios.js/.android.js/.macos.js(andAppleButton.shared.jsconstants). There was no genericAppleButton.js. Expo SDK 52 Metro (EAS, including theexpo export:embedserver pass) resolves that specifier with web/generic source extensions and never tries.ios.js, so the app fails to bundle even when it only usesappleAuth.Reporter listed the missing file and the exact Metro candidate list on #375. The same error is #364 (
iOS Bundledsucceeded, then the server/web pass failed). A commenter confirmed aPlatform.select+require()workaround againstnode_modules.How
Add
lib/AppleButton.jsas the platform-agnostic module those sourceExts look for. ItPlatform.selects the existing iOS / Android / macOS implementations, with the Android JS button asdefault.index.jsis unchanged. When Metro still applies platform suffixes, native iOS/Android/macOS keep using the existing platform files.Decision
AppleButton.jsfallback withPlatform.select.Platform.selectinindex.js(the patch on AppleButton module resolution fails in EAS Build due to missing AppleButton.js file #375), or re-exportAppleButton.android.jswith no select (same shape asAppleButton.macos.js).Platform.selectkeeps the native iOS button if Expo loads the generic file on iOS.defaultis the Android JS button, notAppleButton.shared.js, that file is constants only and has no default export, so the snippet in the issue would have setAppleButtontoundefined.Test plan
AppleButton.jsand passes with it (yarn test)yarn lint/yarn tsc:compilenpm pack --dry-runincludeslib/AppleButton.jsand omits__tests__/expo export:embed(reporter's environment) still succeeds and iOS still shows the native button