Skip to content

Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider #134

Description

@azeezat

Describe the bug
[React] { [Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider] name: 'Invariant Violation',
framesToPop: 1 }

To Reproduce
Steps to reproduce the behavior:

  1. Update from expo SDK 55 to 56

Solution
This error occurs because react-native-input-select bundles its own copy of react-native-safe-area-context, creating a duplicate registration conflict with the one in your project.

To fix this error, Add a package resolution alias In your package.json, force both packages to use the same instance:

{
  "dependencies": { ... },
  "resolutions": {
    "react-native-safe-area-context": "<your-current-version>"
  }
}

Then run yarn install (resolutions only work with Yarn).

If you're using npm/pnpm, use this instead:

For npm — add to package.json:

"overrides": {
  "react-native-safe-area-context": "<your-current-version>"
}

For pnpm — add to package.json:

"pnpm": {
  "overrides": {
    "react-native-safe-area-context": "<your-current-version>"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions