Skip to content

[0.87.0] VirtualizedList triggers Metro package-exports warning #57933

Description

@wojtekmaj

Description

Actual: A fresh React Native 0.87.0 app rendering the public FlatList API makes Metro emit the warning below. Metro falls back to file-based resolution and completes the bundle, but the app itself uses only public React Native APIs.

The import comes from the first-party @react-native/virtualized-lists@0.87.0 package, a direct dependency of react-native@0.87.0. It deep-imports react-native/src/private/featureflags/ReactNativeFeatureFlags in VirtualizedList.js:67 and VirtualizeUtils.js:16. React Native 0.86 exported ./src/*, so this import did not violate its package exports map. PR #57484 removed that mapping for 0.87.0, while both imports remain in 0.87.0 and on main as of 2026-08-13.

Expected: A fresh app using FlatList should bundle without a package-exports warning. The internal imports should use an exported entry point, or react-native should export the subpath they require.

Steps to reproduce

  1. Clone the public reproducer made from the official React Native reproducer template and enter the app:
    git clone https://github.com/wojtekmaj/react-native-087-virtualized-lists-exports-repro.git && cd react-native-087-virtualized-lists-exports-repro/ReproducerApp
  2. Install the locked dependencies:
    npx yarn@1.22.22 install --frozen-lockfile
  3. Run a deterministic iOS Metro bundle (no simulator is required):
    npx react-native bundle --platform ios --dev true --entry-file index.js --bundle-output /tmp/ReproducerApp.jsbundle --assets-dest /tmp/ReproducerApp-assets
  4. Metro prints the package-exports warning, then writes the bundle using file-based resolution.

React Native Version

0.87.0

Affected Platforms

Runtime - iOS, Build - MacOS

Output of npx @react-native-community/cli info

info Fetching system and libraries information...
System:
  OS: macOS 26.6.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 144.61 MB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.17.0
    path: /usr/local/bin/node
  Yarn:
    version: 4.17.1
    path: /usr/local/bin/yarn
  npm:
    version: 11.13.0
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.5
      - iOS 26.5
      - macOS 26.5
      - tvOS 26.5
      - visionOS 26.5
      - watchOS 26.5
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 26.6/17F113
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.2.0
    wanted: 20.2.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.87.0
    wanted: 0.87.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

WARN  Attempted to import the module "/path/to/ReproducerApp/node_modules/react-native/src/private/featureflags/ReactNativeFeatureFlags" which is not listed in the "exports" of "/path/to/ReproducerApp/node_modules/react-native" under the requested subpath "./src/private/featureflags/ReactNativeFeatureFlags". Falling back to file-based resolution. Consider updating the call site or asking the package maintainer(s) to expose this API.

MANDATORY Reproducer

https://github.com/wojtekmaj/react-native-087-virtualized-lists-exports-repro

Screenshots and Videos

Not applicable. The complete normalized warning is included above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions