My release apk is crashing after splashcreen, how do I solve it? - reactjs

my app crashes after the splash screen, for debug works perfectly. I think its something with a dependency but I don't really know and am out of ideas
the flow is the next one, I run gradle installRelease and the app crashes instantly, but if I do a npm run android the app works smoothly without any problems
{
"name": "app",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
"bundle:ios": "react-native bundle --minify --dev false --assets-dest ./ios --entry-file index.js --platform ios --bundle-output ./ios/main.jsbundle",
"postinstall": "npx jetifier && npm run bundle:ios"
},
"dependencies": {
"#amplitude/react-native": "^2.16.0",
"#babel/plugin-transform-arrow-functions": "^7.18.6",
"#babel/plugin-transform-shorthand-properties": "^7.18.6",
"#babel/plugin-transform-template-literals": "^7.18.9",
"#eva-design/eva": "^2.0.0",
"#miblanchard/react-native-slider": "^1.5.0",
"#react-native-async-storage/async-storage": "^1.17.10",
"#react-native-community/art": "^1.2.0",
"#react-native-community/checkbox": "^0.5.12",
"#react-native-community/cli-platform-android": "^9.1.0",
"#react-native-community/datetimepicker": "^6.3.0",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/progress-bar-android": "^1.0.4",
"#react-native-community/progress-view": "^1.3.2",
"#react-native-community/push-notification-ios": "^1.10.1",
"#react-native-firebase/analytics": "^12.7.5",
"#react-native-firebase/app": "^12.7.5",
"#react-native-firebase/dynamic-links": "^12.7.5",
"#react-native-firebase/messaging": "^12.7.5",
"#react-navigation/bottom-tabs": "^5.8.0",
"#react-navigation/drawer": "^5.9.0",
"#react-navigation/native": "^5.7.3",
"#react-navigation/stack": "^5.9.0",
"#reduxjs/toolkit": "^1.5.0",
"#sentry/react-native": "^2.4.0",
"#ui-kitten/components": "^5.0.0",
"#victorzimnikov/react-native-wheel-picker-android": "^3.1.1",
"appcenter": "^4.4.5",
"appcenter-analytics": "^4.4.5",
"appcenter-crashes": "^4.4.5",
"axios": "^0.21.1",
"hoist-non-react-statics": "^3.3.2",
"i18next": "^21.6.0",
"i18next-localstorage-cache": "^1.1.1",
"install": "^0.13.0",
"lodash": "^4.17.21",
"metro": "^0.73.2",
"moment": "^2.29.1",
"npm": "^8.19.2",
"nullthrows": "^1.1.1",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-hook-form": "^6.14.2",
"react-i18next": "^11.15.1",
"react-native": "^0.66.4",
"react-native-anchor-carousel": "^4.0.1",
"react-native-animated-dots-carousel": "^1.0.1",
"react-native-app-intro-slider": "^4.0.4",
"react-native-blob-util": "^0.16.2",
"react-native-chart-kit": "^6.11.0",
"react-native-charts-wrapper": "^0.5.9",
"react-native-check-box": "^2.1.7",
"react-native-dialog": "^8.0.1",
"react-native-element-dropdown": "^1.8.4",
"react-native-elements": "^3.2.0",
"react-native-gesture-handler": "^2.6.2",
"react-native-image-picker": "^3.1.2",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-languages": "^3.0.2",
"react-native-modal-datetime-picker": "^9.1.0",
"react-native-pager-view": "^5.4.1",
"react-native-pdf": "^6.5.0",
"react-native-progress": "^4.1.2",
"react-native-progress-wheel": "^1.0.5",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "^2.11.0",
"react-native-responsive-screen": "^1.4.2",
"react-native-safe-area-context": "^3.1.7",
"react-native-screens": "^2.10.1",
"react-native-searchable-dropdown": "^1.1.1",
"react-native-shadow": "^1.2.2",
"react-native-share": "^6.2.1",
"react-native-simple-toast": "^1.1.3",
"react-native-snap-carousel": "^3.9.1",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.0",
"react-native-swipe-list-view": "^3.2.6",
"react-native-swipe-modal-up-down": "^1.0.9",
"react-native-swipeable": "^0.6.0",
"react-native-tab-view": "^3.1.1",
"react-native-vector-icons": "^8.1.0",
"react-native-version-number": "^0.3.6",
"react-native-video": "^5.1.0-alpha8",
"react-native-view-overflow": "^0.0.5",
"react-native-webview": "^11.2.3",
"react-native-wheel-pick": "^1.1.1",
"react-native-wifi-reborn": "^4.7.0",
"react-navigation": "^4.4.0",
"react-navigation-stack": "^2.8.2",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"#babel/core": "^7.13.0",
"#babel/runtime": "^7.19.4",
"#react-native-community/eslint-config": "2.0.0",
"#ui-kitten/metro-config": "^5.0.0",
"babel-jest": "26.6.3",
"eslint": "7.14.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.1.0",
"jest": "26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"prettier": "^2.2.1",
"react-test-renderer": "^17.0.2"
},
"jest": {
"preset": "react-native"
}
}
Here's the build.gradle
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/#sentry/react-native/sentry.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
android {
packagingOptions {
pickFirst '**/*.so'
}
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.hobeen.android"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1661850434
versionName "0.2.7"
multiDexEnabled true
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
storeFile file('keystore.jks')
keyAlias 'upload'
storePassword '8VNfjUzFPti5wF'
keyPassword '8VNfjUzFPti5wF'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.google.firebase:firebase-analytics:17.5.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation 'com.facebook.fresco:fresco:2.6.0'
// For animated GIF support
implementation 'com.facebook.fresco:animated-gif:2.6.0'
// For WebP support, including animated WebP
implementation 'com.facebook.fresco:animated-webp:2.6.0'
implementation 'com.facebook.fresco:webpsupport:2.6.0'
implementation 'com.android.support:support-core-utils:24.2.1'
implementation project(path: ":#react-native-firebase_dynamic-links")
implementation project(':react-native-push-notification')
implementation 'androidx.multidex:multidex:2.0.1'
implementation platform('com.google.firebase:firebase-bom:26.2.0')
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.android.support:design:28.+'
implementation project(':react-native-wifi-reborn')
implementation project(':react-native-screens')
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
apply from: file("../../node_modules/#react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
and here's the logcat
10-18 11:52:56.136 18286 18286 E .hobeen.android: Not starting debugger since process cannot load the jdwp agent.
10-18 11:52:56.669 18286 18286 E unknown:ReactNative: Unable to launch logbox because react was unable to create the root view
10-18 11:52:57.031 18286 18341 E ReactNativeJS: TypeError: null is not an object (evaluating 'O.init')
10-18 11:52:57.045 18286 18341 E ReactNativeJS: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
10-18 11:52:57.133 18286 18342 E AndroidRuntime: Process: com.hobeen.android, PID: 18286
10-18 11:52:57.133 18286 18342 E AndroidRuntime: com.facebook.react.common.JavascriptException: TypeError: null is not an object (evaluating 'O.init'), stack:
10-18 11:52:57.133 18286 18342 E AndroidRuntime: setOptions#1186:1182
10-18 11:52:57.133 18286 18342 E AndroidRuntime: <unknown>#1182:416
10-18 11:52:57.133 18286 18342 E AndroidRuntime: v#2:1473
10-18 11:52:57.133 18286 18342 E AndroidRuntime: <unknown>#1158:179
10-18 11:52:57.133 18286 18342 E AndroidRuntime: v#2:1473
10-18 11:52:57.133 18286 18342 E AndroidRuntime: <unknown>#609:273
10-18 11:52:57.133 18286 18342 E AndroidRuntime: v#2:1473
10-18 11:52:57.133 18286 18342 E AndroidRuntime: <unknown>#446:170
10-18 11:52:57.133 18286 18342 E AndroidRuntime: v#2:1473
10-18 11:52:57.133 18286 18342 E AndroidRuntime: <unknown>#406:176
10-18 11:52:57.133 18286 18342 E AndroidRuntime: v#2:1473
10-18 11:52:57.133 18286 18342 E AndroidRuntime: <unknown>#6:57
10-18 11:52:57.133 18286 18342 E AndroidRuntime: v#2:1473
10-18 11:52:57.133 18286 18342 E AndroidRuntime: d#2:875
10-18 11:52:57.133 18286 18342 E AndroidRuntime: global code#1720:3
10-18 11:52:57.133 18286 18342 E AndroidRuntime:
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:942)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
10-18 11:52:57.133 18286 18342 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: [AppErrors] null InputStream [CONTEXT service_id=254 ]
10-18 11:52:57.264 6892 18370 E DropBoxUtil: java.io.IOException: null InputStream
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at btqk.c(:com.google.android.gms#223616044#22.36.16 (190400-476895098):20)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at bton.apply(:com.google.android.gms#223616044#22.36.16 (190400-476895098):5)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at jrl.apply(:com.google.android.gms#223616044#22.36.16 (190400-476895098):0)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at jrz.apply(:com.google.android.gms#223616044#22.36.16 (190400-476895098):5)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at ckud.a(:com.google.android.gms#223616044#22.36.16 (190400-476895098):0)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at csyd.a(:com.google.android.gms#223616044#22.36.16 (190400-476895098):2)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at cyus.d(:com.google.android.gms#223616044#22.36.16 (190400-476895098):2)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at cyuu.run(:com.google.android.gms#223616044#22.36.16 (190400-476895098):9)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at cywe.execute(:com.google.android.gms#223616044#22.36.16 (190400-476895098):0)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at cyuq.q(:com.google.android.gms#223616044#22.36.16 (190400-476895098):1)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at cyuq.gl(:com.google.android.gms#223616044#22.36.16 (190400-476895098):4)
10-18 11:52:57.264 6892 18370 E DropBoxUtil: at cyuu.g(:com.google.android.gms#223616044#22.36.16 (190400-47689509

Related

ERROR ReferenceError: Can't find variable: r

Whenever I run my React Native project (after removing node_modules, .gradle, .idea, android/app/build, android/build)
I get the following error in my metro server:
info Reloading app...
[Fri Jun 11 2021 14:46:49.120] BUNDLE ./index.js
[Fri Jun 11 2021 14:46:50.778] ERROR ReferenceError: Can't find variable: r
[Fri Jun 11 2021 14:46:50.780] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Fri Jun 11 2021 14:46:50.782] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
exported = true is in all my activity entries in manifest:
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"
android:exported="true"/>
This is my package.json:
{
"name": "HeraMedica",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start --reset-cache",
"test": "jest",
"lint": "eslint .",
"postinstall": "patch-package"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.15.4",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/datetimepicker": "^2.6.2",
"#react-native-community/masked-view": "^0.1.10",
"#react-native-community/netinfo": "^6.0.0",
"#react-native-google-signin/google-signin": "^6.0.0",
"#react-native-picker/picker": "^1.15.0",
"#react-navigation/drawer": "^5.12.5",
"#react-navigation/material-top-tabs": "^5.3.15",
"#react-navigation/native": "^5.9.3",
"#react-navigation/stack": "^5.14.3",
"moment": "^2.29.1",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-crypto-js": "^1.0.0",
"react-native-fbsdk": "^3.0.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^2.1.0",
"react-native-material-dropdown": "^0.11.1",
"react-native-material-textfield": "^0.16.1",
"react-native-modal-datetime-picker": "^9.2.3",
"react-native-pager-view": "^5.1.10",
"react-native-picker-select": "^8.0.4",
"react-native-reanimated": "^2.1.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^2.18.1",
"react-native-switch": "^2.0.0",
"react-native-tab-view": "^3.0.1",
"react-native-table-component": "^1.2.1",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"#babel/core": "^7.8.4",
"#babel/runtime": "^7.8.4",
"#react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
UPDATE:
When I am in another branch of the same repository using same package.json configuration, I am getting other errors:
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:592:3)
at tryReadSync (fs.js:366:20)
at Object.readFileSync (fs.js:403:19)
at UnableToResolveError.buildCodeFrameMessage (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:304:17)
at new UnableToResolveError (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:290:35)
at ModuleResolver.resolveDependency (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:168:15)
at DependencyGraph.resolveDependency (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
at /Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/lib/transformHelpers.js:271:42
at Server.<anonymous> (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/Server.js:842:41)
at Generator.next (<anonymous>)
I located the error using debugging:
The screenshot for how debugging help out to find this bug.
However there are other series of bugs. One of my developers has done mischief.

react-static: ReferenceError while building

This error occurs when a project is build.
I think it's because I don't have a react-static build, but I don't know the error.
package.json
"dependencies": {
"#reach/router": "^1.2.1",
"aos": "^2.3.4",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-router-dom": "^5.1.2",
"react-static": "^7.2.0",
"react-static-plugin-reach-router": "^7.2.0",
"react-static-plugin-sass": "^7.2.2",
"react-static-plugin-sitemap": "^7.2.0",
"react-static-plugin-source-filesystem": "^7.2.0",
....
},
build command:
yarn build
(but react-static build command is react-static build)
error
ReferenceError: Failed exporting HTML for URL / (/Users/youj/projects/project_name/src/pages/index.js): document is not defined
- aos.js:1 n
[project_name]/[aos]/dist/aos.js:1:14577
- aos.js:1 Object._ [as init]
[project_name]/[aos]/dist/aos.js:1:1530
- static-app.js:1850 MainFunction
/Users/youj/projects/project_name/artifacts/static-app.js:1850:26
- react-dom-server.node.production.min.js:36 d
[project_name]/[react-dom]/cjs/react-dom-server.node.production.min.js:36:498
- react-dom-server.node.production.min.js:39 Za
[project_namee]/[react-dom]/cjs/react-dom-server.node.production.min.js:39:16
- react-dom-server.node.production.min.js:44 a.b.render
[project_name]/[react-dom]/cjs/react-dom-server.node.production.min.js:44:476
- react-dom-server.node.production.min.js:44 a.b.read
[project_name]/[react-dom]/cjs/react-dom-server.node.production.min.js:44:18
- react-dom-server.node.production.min.js:54 renderToString
[project_name]/[react-dom]/cjs/react-dom-server.node.production.min.js:54:364
- exportRoute.js:137 renderToStringAndExtract
[project_name]/[react-static]/src/static/exportRoute.js:137:21
- exportRoute.js:194 _callee$
[project_name]/[react-static]/src/static/exportRoute.js:194:15
tree
├──src
├──index.js (render app.js)
├── pages
│ ├── 404.js
│ └── index.js (call view components)
It is aos error!
This has been settled.
if (process.browser) {
AOS.init({
duration: 600,
easing: 'ease-in-cubic',
delay: 1200,
anchorPlacement: 'bottom-bottom',
});
}

Google closure compiler build gives error Unhandled flag: outputManifest'

Trying to implement google closure compiler to existing angularjs project. When i build application i get error java.lang.RuntimeException: Unhandled flag: outputManifest.
Here is package.json:
"devDependencies": {
"angular-mocks": "^1.7.8",
"expect.js": "^0.3.1",
"google-closure-compiler": "^20190909.0.0",
"google-closure-deps": "^20190909.0.0",
"google-closure-library": "^20190909.0.0",
"karma": "^4.3.0",
"karma-mocha": "1.3.0",
"karma-phantomjs-launcher": "1.0.4",
"less": "^3.10.3",
"mocha": "^6.2.1",
"ng-annotate": "1.2.2",
"sinon": "^7.5.0"
},
"dependencies": {
"angular": "^1.7.8",
"angular-animate": "^1.7.8",
"angular-translate": "^2.18.1",
"bootstrap": "^3.4.1",
"cesium": "^1.62.0",
"jquery": "^3.4.1",
"ol": "^6.0.1",
"olcs": "^2.9.0",
"proj4": "^2.5.0",
"url-polyfill": "^1.1.7"
}
Here is error:
{ Error: java.lang.RuntimeException: Unhandled flag: outputManifest
at mQ.QN [as Dg] (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:8941:25462)
at mQ.TN [as Fg] (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:8941:25657)
at mQ.ON (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:2802:48)
at mQ.WN (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:966:19)
at new mQ (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:967:19)
at SHd (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:8802:132)
at DQ (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:2286:29)
at GQ (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:3753:44)
at /vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:3971:46
at CompilerJS.run (/vagrant/source/node_modules/google-closure-compiler/lib/node/closure-compiler-js.js:54:17)
at getFilesFromStdin.then.inputFiles (/vagrant/source/node_modules/google-closure-compiler/cli.js:164:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
'__java$exception':
{ g: null,
e: 'Unhandled flag: outputManifest',
backingJsObject: [Circular] } }
According to Closure Compiler's Flags and Option documentation:
--output_manifest VAL [is] Not supported by the JavaScript version
While I do not see closure-compiler-js in your package.json, I do see in your error report that you are using it to compile.
at mQ.TN [as Fg] (/vagrant/source/node_modules/google-closure-compiler-js/jscomp.js:8941:25657)
^^^^^^^^^^^^^^^^^^^^^^^^^^
So the solution to this would be either to stop using the JS version or start using flags that it supports.

React Native : Error: jest-haste-map: Haste module naming collision, Duplicate module name: react-animated

I have 2 modules.
react native-app
react native storybook
Download Source Code local.properties put your android sdk path
Getting below error when I run npm start
Looking for JS files in
/home/company/Desktop/projects/someapp/vendorapp
Loading dependency graph...(node:9505) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
Duplicate module name: react-animated
Paths: /home/company/Desktop/projects/someapp/vendorapp/node_modules/storybook/node_modules/react-native/Libraries/Animated/release/package.json collides with /home/company/Desktop/projects/someapp/vendorapp/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by `hasteImpl` returning the same name for different files.
at setModule (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:569:17)
at workerReply (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:641:9)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:9505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:9505) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:9505) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
Duplicate module name: react-animated
Paths: /home/company/Desktop/projects/someapp/vendorapp/node_modules/storybook/node_modules/react-native/Libraries/Animated/release/package.json collides with /home/company/Desktop/projects/someapp/vendorapp/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by `hasteImpl` returning the same name for different files.
at setModule (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:569:17)
at workerReply (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:641:9)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:9505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
Not able to figure out tried lot of other stackoverflow links but none of them solved. Below are the details of package.json file
Let me know if any other details are needed.
react-native storybook Package.json
{
"name": "storybook",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"storybook": "storybook start"
},
"dependencies": {
"native-base": "^2.8.2",
"react": "16.6.3",
"react-native": "0.58.3",
"react-native-material-textfield": "^0.12.0",
"toggle-switch-react-native": "^2.0.2"
},
"devDependencies": {
"#storybook/addon-actions": "^4.1.2",
"#storybook/addon-links": "^4.1.2",
"#storybook/addons": "^4.1.2",
"#storybook/react-native": "^4.1.2",
"babel-core": "^6.26.3",
"babel-jest": "23.6.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-runtime": "^6.26.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.49.2",
"prop-types": "^15.6.2",
"react-dom": "16.6.3",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
react native app
{
"name": "vendorapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.3",
"react-redux": "^6.0.0",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"storybook": "../storybook"
},
"devDependencies": {
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "24.0.0",
"jest": "24.0.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}

Interface 'NodeModule' cannot simultaneously extend types 'Module' and 'Module'

I'm use React.
After create-react-app --typescript I've added few libraries to package.json after that I received exception in runtime.
TypeScript error in D:/catalog/node_modules/#types/node/globals.d.ts(223,11):
Interface 'NodeModule' cannot simultaneously extend types 'Module' and 'Module'.
Named property 'hot' of types 'Module' and 'Module' are not identical. TS2320
221 | declare var require: NodeRequire;
222 |
> 223 | interface NodeModule {
| ^
224 | exports: any;
225 | require: NodeRequireFunction;
226 | id: string;
I tried
1) remove node_moduls/install again
2) clear cache
Fortunatly my project builds, but exception appear in runtime
My package.json
{
"dependencies": {
"#types/bootstrap": "^4.2.0",
"#types/faker": "^4.1.4",
"#types/node": "12.11.2",
"#types/parcel-env": "^0.0.0",
"#types/ramda": "^0.25.48",
"#types/react-dom": "16.9.2",
"#types/react-router": "^4.4.3",
"#types/react-router-dom": "^4.3.1",
"#types/recompose": "^0.30.3",
"#types/styled-components": "4.1.16",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react-scripts": "3.2.0",
"remotedev": "^0.2.9",
"yarn-deduplicate": "^1.1.1"
},
"devDependencies": {
"#types/react": "16.8.19",
"#types/enzyme": "^3.9.0",
"#types/enzyme-adapter-react-16": "^1.0.5",
"#types/jest": "^23.3.10",
"#types/webpack": "^4.4.24",
"#types/webpack-env": "^1.13.6",
"awesome-typescript-loader": "^5.2.1",
"cross-env": "^5.2.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.1",
"lerna": "^3.15.0",
"prettier": "^1.15.3",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.4",
"tslint-plugin-prettier": "^2.0.1",
"tslint-react": "^3.6.0",
"typescript": "3.6.4",
"typescript-plugin-styled-components": "^1.0.0"
},
"resolutions": {
"#types/react": "16.8.19"
},
}
React/typescript/yarn.
Try updating #types/webpack-env to latest version. Worked for me.
This usually means that the version of #types/node you've specify in your package.json's devDependencies is incompatible with the one used under the hood by one of your dependencies.
For instance you will get this error if you've specified "#types/node": "13.9.1" but use a "#nestjs/cli": "^7.0.0" because that latter lib is using itself "#types/node": "12.12.31".
A workaround for this is to lower your the #types/node version of your project to the lowest common denominator, so "12.12.31" in this example.
After moved all #types to devDependencies exception doesn't appear

Resources