Skip to content

🐛 Bug Report: TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found #45

Closed
@nolliebigspin

Description

@nolliebigspin

👟 Reproduction steps

Hello together,

I am building an Expo / RN app and try to implement my authentication with the createMagicURLToken() function.

I followed all documentation steps to create my Appwrite client like the following:

import { Account, Client } from "react-native-appwrite";

const client = new Client()
  .setEndpoint("https://cloud.appwrite.io/v1")
  .setProject("PROJECT_ID")
  .setPlatform("PLATFORM");

export const account = new Account(client);

In my authentication part I use createMagicURLToken like in the docs explained:

import { ID } from "react-native-appwrite";

  try {
    const token = await account.createMagicURLToken(
      ID.unique(),
      "[email protected]",
      "URL"
    );

    return { token };
  } catch (error) {
    console.error(error);
  }

At this point, when the createMagicURLToken is executed, my application crashes with the following message:

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: true. TurboModule interop: false. Modules loaded: {"NativeModules":[],"TurboModules":[],"NotFound":["PlatformConstants"]}


I saw that this library has the following dependencies and was thinking if this might be a problem with the react-native version. I use the newest 0.77.0 like described later in my environment settings.

"dependencies": {
    "expo-file-system": "16.0.8",
    "react-native": "^0.73.6"
},

👍 Expected behavior

That the function runs through or at least giving me a better instruction what might gone wrong.

👎 Actual Behavior

Image

🎲 Appwrite version

Different version (specify in environment)

💻 Operating system

MacOS

🧱 Your Environment

I use appwrite in the cloud, so it should be v1.6.x

expo: 52.0.33
react-native: 0.77.0
react-native-appwrite: 0.7.0
react-native-url-polyfill: 2.0.0

Devices:

  • iPhone 15 Pro Max (iOS 17.2 - Simulator)
  • iPhone 14 Pro (iOS 18.1.1)

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions