Skip to content

Package subpath './src/lib/countLines' is not defined by "exports" #5066

Description

@lvothnrv

What React Native libraries do you use?

React Native without Frameworks

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.19.0

How does your development environment look like?

System:
  OS: macOS 15.5
  CPU: (14) arm64 Apple M4 Pro
  Memory: 145.81 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.18.0
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.3
    path: /usr/local/bin/npm
  Watchman:
    version: 2025.06.23.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11567975
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.0
    wanted: 0.81.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Sentry.init()

Sentry.init({
  dsn: 'https://68f9170....2@....68.ingest.de.sentry.io/.....',
  // uncomment the line below to enable Spotlight (https://spotlightjs.com)
  // spotlight: __DEV__,
});

Steps to Reproduce

Install Sentry on react native version 0.81.0

Expected Result

That we can do npm start npm run ios or npm run android

Actual Result

Currently, regardless of the npm run we do, we have :
Package subpath './src/lib/countLines' is not defined by "exports" in ……./node_modules/metro/package.json.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/lib/countLines' is not defined by "exports" in ……./node_modules/metro/package.json
at exportsNotFound (node:internal/modules/esm/resolve:313:10)
at packageExportsResolve (node:internal/modules/esm/resolve:660:9)
at resolveExports (node:internal/modules/cjs/loader:646:36)
at Function._findPath (node:internal/modules/cjs/loader:713:31)
at Function._resolveFilename (node:internal/modules/cjs/loader:1351:27)
at defaultResolveImpl (node:internal/modules/cjs/loader:1021:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1026:22)
at Function._load (node:internal/modules/cjs/loader:1175:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions