You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 4.09 GB / 16.00 GB
Shell: 2.7.1 - /usr/local/bin/fish
Binaries:
Node: 8.11.4 - ~/.nvm/versions/node/v8.11.4/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.11.4/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.2, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.1, 27.0.3, 28.0.1, 28.0.2, 28.0.3
System Images: android-25 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
Description
I created a new typescript project with the CLI (e.g. react-native init <my project> --template typescript and am noticing several issues that I hope can be addressed.
The project does not build. I run node ./node_modules/.bin/tsc and receive the following error: setup.js:1:1 - error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided. To fix this I just set the isolatedModules setting in tsconfig.json to "false".
The project does not run. After building the project and attempting to run the project on a connected device and that fails because it's looking for the APK file in the wrong place, e.g. react-native run-android --deviceId <my device id> results in the following:
adb: failed to stat app/build/outputs/apk/app-debug.apk: No such file or directory
Command failed: /usr/local/share/android-sdk/platform-tools/adb -s 99523a0828712a92 install app/build/outputs/apk/app-debug.apk
Could not install the app on the device, read the error above for details.
This is because the APK builds to apk/debug/app-debug.apk, not apk/app-debug.apk!!!
I even tried explicitly adding the --variant debug flag and it still insists on looking for the APK in the parent folder (instead of in the "debug" child folder where the APK was built to).
After initializing the project I noticed several warnings related to missing peer dependencies. Some concerning ones relate to the version of react and the version of babel:
warning " > react-native@0.57.8" has unmet peer dependency "react@16.6.3".
warning "metro-react-native-babel-preset > @babel/plugin-transform-sticky-regex@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
Should I be concerned about these warnings? What should I do about these warnings?
Reproducible Demo
run react-native init TestProject --template typescript. Notice all the warnings related to unmet peer dependencies (especially react-native's unmet peer dependency of REACT!!!)
attempt to build the project via node ./node_modules/.bin/tsc -- it will fail because of the typescript configuration mentioned above
fix the build error and attempt to run the project on a connected device via react-native run-android --deviceId <your device> and it will fail to install the APK on the device because it's looking in the wrong folder for the APK.
The text was updated successfully, but these errors were encountered:
Environment
Output of
react-native info
:Description
I created a new typescript project with the CLI (e.g.
react-native init <my project> --template typescript
and am noticing several issues that I hope can be addressed.node ./node_modules/.bin/tsc
and receive the following error:setup.js:1:1 - error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
To fix this I just set theisolatedModules
setting in tsconfig.json to "false".react-native run-android --deviceId <my device id>
results in the following:This is because the APK builds to
apk/debug/app-debug.apk
, notapk/app-debug.apk
!!!--variant debug
flag and it still insists on looking for the APK in the parent folder (instead of in the "debug" child folder where the APK was built to).After initializing the project I noticed several warnings related to missing peer dependencies. Some concerning ones relate to the version of react and the version of babel:
Should I be concerned about these warnings? What should I do about these warnings?
Reproducible Demo
react-native init TestProject --template typescript
. Notice all the warnings related to unmet peer dependencies (especially react-native's unmet peer dependency of REACT!!!)node ./node_modules/.bin/tsc
-- it will fail because of the typescript configuration mentioned abovereact-native run-android --deviceId <your device>
and it will fail to install the APK on the device because it's looking in the wrong folder for the APK.The text was updated successfully, but these errors were encountered: