Skip to content

iOS: victory-native module exports warning during bundling #8

Description

@alex-pythonista

Description

During iOS bundling, a warning is displayed about the victory-native module's exports configuration. While this is currently just a warning (not blocking), it indicates a potential compatibility issue that could cause problems in future Metro/Expo versions.

Warning Message

WARN  Attempted to import the module "/Users/alexpy/Desktop/projects/helm-all/helm/node_modules/victory-native" which is listed in the "exports" of "/Users/alexpy/Desktop/projects/helm-all/helm/node_modules/victory-native", however no match was resolved for this request (platform = ios). Falling back to file-based resolution. Consider updating the call site or asking the package maintainer(s) to expose this API.

Root Cause

This warning occurs because victory-native's package.json exports field doesn't properly define an entry point for the ios platform condition. Metro bundler (used by Expo/React Native) is falling back to file-based resolution, which works but is not ideal.

The package is used in components/dynamic-chart.tsx for chart visualization.

Current Usage

  • Package: victory-native ^41.16.1
  • Location: components/dynamic-chart.tsx

Potential Solutions

Option 1: Wait for upstream fix (Recommended)

This is a known issue with victory-native's exports configuration. Monitor the victory-native repository for updates:

Option 2: Use metro.config.js workaround

Add an unstable_enablePackageExports configuration to suppress or handle the warning:

// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');

const config = getDefaultConfig(__dirname);

config.resolver.unstable_enablePackageExports = false;

module.exports = config;

Note: This disables package exports resolution entirely, which may have other side effects.

Option 3: Alternative charting library

If the warning becomes a blocking issue, consider alternative React Native charting libraries:

  • react-native-chart-kit
  • react-native-gifted-charts
  • @shopify/react-native-skia based charts (already in dependencies)

Impact

  • Severity: Low (warning only, app functions correctly)
  • Current Behavior: App works normally, Metro falls back to file-based resolution
  • Future Risk: May become a breaking change in future Metro versions

Environment

  • victory-native: ^41.16.1
  • expo: ^53.0.6
  • react-native: 0.79.2
  • Metro bundler (via Expo)

Related

This may be related to Metro's ongoing work on package exports support:

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions