RN 0.87 compatibility - Metro fails to resolve `@react-native/assets-registry/registry` when importing from `react-native-svg/css`

Author: SimpleCreationsCreated Aug 14, 2026Updated Sep 3, 2026
LabelsRepro provided

Description

After upgrading to React Native 0.87, Metro fails when bundling code that imports from react-native-svg/css (e.g. SvgCssUri).

ERROR  Error: Unable to resolve module @react-native/assets-registry/registry from .../react-native-svg/src/lib/resolveAssetUri.ts: @react-native/assets-registry/registry could not be found within the project or in these directories:
  node_modules
>  7 | import { getAssetByID } from '@react-native/assets-registry/registry';

Expected: Imports from react-native-svg/css bundle successfully on RN 0.87.

Actual: Metro cannot resolve @react-native/assets-registry/registry.

Root cause: [email protected] imports @react-native/assets-registry/registry in src/lib/resolveAssetUri.ts, which is used by the /css subpath (LocalSvg.tsxresolveAssetUri.ts). React Native 0.87 no longer lists @react-native/assets-registry as a dependency of react-native (it was present in 0.86). The package is therefore not installed transitively.

Workarounds:

  1. Add @react-native/[email protected] as a direct dependency.
  2. Metro alias: '@react-native/assets-registry/registry'react-native/asset-registry.

Steps to reproduce

  1. Create a fresh RN 0.87 app (npx @react-native-community/cli init).

  2. Install [email protected].

  3. Import from the /css subpath:

    typescript
    import { SvgCssUri } from 'react-native-svg/css';
    
    export function App() {
      return <SvgCssUri uri="https://example.com/icon.svg" width={100} height={100} />;
    }
  4. Run Metro (npx react-native start) or bundle (npx react-native bundle --platform ios --dev true --entry-file index.js --bundle-output /tmp/test.bundle).

  5. Observe the @react-native/assets-registry/registry resolution error.

Snack or a link to a repository

https://github.com/SimpleCreations/SEE_STEPS_TO_REPRODUCE

SVG version

15.15.5

React Native version

0.87.0

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

Source: software-mansion/react-native-svg