react-native
react-native copied to clipboard
Option 'customConditions' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'
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
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
| :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. |
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
| :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. |
@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.
@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.
Faced the same issue and updated moduleResolution: Node to moduleResolution: bundler in tsconfig.json.
Faced the same issue and updated
moduleResolution: NodetomoduleResolution: bundlerintsconfig.json.
Worked but now I'm getting:
Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
I'm getting this as we speak...
Same here.
Same here. Updated react-native from 0.76.9 to 0.79.3.
Same here. I updated the Expo SDK from 52 to 53 which includes an update from react-native to 0.79
FYI: I had it fixed. If I recall correctly, it was related to my tsoncfig.ts. Before, I was not extending @react-native/typescript-config/tsconfig.json and had multiple customizations, now it is down to:
{
"extends": "@react-native/typescript-config/tsconfig.json",
"compilerOptions": {
"noUnusedLocals": true,
"noUnusedParameters": true,
"downlevelIteration": true,
}
}
Note: That was when I upgraded to 76, I see reports for 79, maybe something different now!