facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.49k stars 24.37k forks source link

Option 'customConditions' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler' #47172

Open therealkh opened 1 month ago

therealkh commented 1 month ago

Description

I upgraded my project to 0.75.3. I know that newer version of react native upgrades typescript as well. I will provide our tsconfig.json below. This configuration was working perfectly on 0.72 version. I wonder what should be changed there

tsconfig.json:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "lib": ["es2017", "ES2021.String"],
    "allowJs": true,
    "jsx": "react-native",
    "noEmit": true,
    "isolatedModules": true,
    "strict": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "baseUrl": "./",
    "paths": {
      "~/*": ["src/*"]
    }
  },
  "include": ["src/**/*", "App.tsx"],
  "extends": "@react-native/typescript-config/tsconfig.json"
}

Steps to reproduce

unfortunately project is private and I cannot provide repo(

React Native Version

0.75.3

Affected Platforms

Other (please specify)

Output of npx react-native info

System:
  OS: macOS 15.0
  CPU: (8) arm64 Apple M1 Pro
  Memory: 78.27 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.1.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v18.16.0/bin/yarn
  npm:
    version: 10.2.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.11.06.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /Users/uktam/.rvm/gems/ruby-2.7.8/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2024.1 AI-241.19072.14.2412.12360217
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.7.8
    path: /Users/uktam/.rvm/rubies/ruby-2.7.8/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 14.1.1
    wanted: ^14.1.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.3
    wanted: 0.75.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

there is no stacktrace logs

Reproducer

-

Screenshots and Videos

No response

react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 1 month ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.75.4. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
react-native-bot commented 1 month ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
shubhamguptadream11 commented 1 month ago

@therealkh We need a valid reproducer to check this at our end. Also mention any stacktrace or logs related to issue you are using. You can use this reproducer.

UnicodeTech-PVT commented 3 weeks ago

@therealkh To assist effectively, please provide a valid reproducer for the issue so we can replicate it on our end. Make sure to include any relevant stack traces, logs, or error messages you’re encountering, as these will help us understand the problem in greater detail. Additionally, if there are any specific configurations or environment details involved (e.g., OS version, dependencies, or frameworks), please share those as well. You can use this reproducer to guide your setup.

ja-ka commented 2 weeks ago

Faced the same issue and updated moduleResolution: Node to moduleResolution: bundler in tsconfig.json.

GSFZamai commented 1 week ago

Faced the same issue and updated moduleResolution: Node to moduleResolution: bundler in tsconfig.json.

Worked but now I'm getting:

Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later