Skip to content

Usage with RN Web #342

Closed
Closed

Description

@gavrilikhin-d

Is this possible to use this library with RN Web?

Currently, there is an error:

ERROR in ./node_modules/@invertase/react-native-apple-authentication/lib/index.js 24:0-55
Module not found: Error: Can't resolve './AppleButton' in 
'/Users/gavrilikhin_d/Code/chatroulette/app/mobile/node_modules/@invertase/react-native-apple-authentication/lib'

Activity

  1. mikehardy commented on Feb 8, 2024

    @mikehardy
    Collaborator

    #335 needs testing. If working on the web is important please pull that PR (perhaps rebase it to current main...) and test it, report findings

  2. gavrilikhin-d commented on Feb 9, 2024

    @gavrilikhin-d
    Author

    There is still no AppleButton.web.js in this PR

  3. mikehardy commented on Feb 9, 2024

    @mikehardy
    Collaborator

    @gavrilikhin-d okay, then perhaps that PR needs additional work - if you have the PR pulled locally and web implementation is important, adding additional commits on the original PR and proposing a new + augmented PR could be the way forward

  4. gavrilikhin-d commented on Feb 9, 2024

    @gavrilikhin-d
    Author
  5. rwitchell commented on Nov 15, 2024

    @rwitchell

    @mikehardy: this is causing storybook to fail to build with the same error.

  6. mikehardy commented on Nov 15, 2024

    @mikehardy
    Collaborator

    @rwitchell the path forward here is to get #335 patched up and working - I haven't had time personally, but fixing it up and pushing a new PR that works means I could merge it and this would be solved

  7. encloinc commented on Feb 11, 2025

    @encloinc

    Heres how I fixed it with expo:

    For expo create a polyfill for it like so:

    https://gist.github.com/encloinc/91a5ca08d7be9e0ecdb5e208c3e5d9c5
    (change it to use the scopes you need)

    and then on metro make it resolve to the polyfill if platform is web (metro.config.js):

    config.resolver.resolveRequest = (context, realModuleName, platform) => {
      if (
        realModuleName.includes("react-native-apple-authentication") &&
        platform === "web"
      ) {
        return {
          filePath: path.join(
            __dirname,
            "polyfills/react-native-apple-authentication.js"
          ),
          type: "sourceFile",
        };
      }
      return context.resolveRequest(context, realModuleName, platform);
    };
  8. AkbarBakhshi commented on Feb 23, 2025

    @AkbarBakhshi

    Trying to implement Universal Links and need to build my app for web. npx expo export --platform web still throwing that error for the AppleButton.

    Error: Unable to resolve module ./AppleButton.

    Is there a workaround? like ignoring Apple Authentication for web build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions