Unable to run my Expo app on LAN React Native - javascript

I've updated my expo version to the latest. but unfortunately I don't know why my LAN is not working and expo. I've already tried lots of things example.
expo r -c
Delete node_modules and then npm install
but nothing works for me.
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"axios": "^0.19.0",
"expo": "^35.0.0",
"expo-device": "~1.0.0",
"expo-font": "~7.0.0",
"native-base": "^2.13.8",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-dialog": "^5.6.0",
"react-native-gesture-handler": "~1.3.0",
"react-native-material-menu": "^1.0.0",
"react-native-modal": "^11.5.3",
"react-native-modal-filter-picker": "^1.3.4",
"react-native-multiple-select": "^0.5.5",
"react-native-paper": "^3.2.1",
"react-native-reanimated": "~1.2.0",
"react-native-simple-radio-button": "^2.7.4",
"react-native-web": "^0.11.7",
"react-navigation": "^4.0.10",
"react-navigation-drawer": "^2.3.3",
"react-navigation-stack": "^1.10.3"
},
"devDependencies": {
"babel-preset-expo": "^7.1.0"
},
"private": true
}

please try to update following in package.json
"expo-cli": "3.11.5"
Then remove node_modules
npm install

Related

craco don't work with react-scripts#^5.0.1

it shows me this error:
yarn start  ✔  27s 
yarn run v1.22.19
$ craco start
Failed to compile.
For the selected environment is no default script chunk format available:
JSONP Array push can be chosen when 'document' or 'importScripts' is available.
CommonJs exports can be chosen when 'require' or node builtins are available.
Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively, specify the 'output.chunkFormat' directly.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
And this is my Package.json
{
"name": "fly-with-zoki",
"version": "1.10.0",
"private": true,
"main": "dist/index.js",
"dependencies": {
"#babel/helper-define-polyfill-provider": "^0.3.2",
"#date-io/date-fns": "^1.3.13",
"#emotion/react": "^11.10.5",
"#emotion/styled": "^11.10.5",
"#fontsource/roboto": "^4.5.8",
"#material-ui/core": "^4.12.4",
"#material-ui/icons": "4.11.2",
"#material-ui/lab": "^4.0.0-alpha.61",
"#material-ui/pickers": "^3.3.10",
"#mui/icons-material": "^5.10.16",
"#mui/lab": "^5.0.0-alpha.114",
"#mui/material": "^5.10.17",
"#mui/styled-engine-sc": "^5.10.16",
"#reduxjs/toolkit": "^1.8.0",
"#stripe/react-stripe-js": "^1.8.0-0",
"#stripe/stripe-js": "^1.29.0",
"#types/dotenv": "^8.2.0",
"amadeus": "^7.1.0",
"axios": "^0.27.1",
"bootstrap": "^4.6.1",
"chartist": "0.10.1",
"classnames": "2.3.1",
"date-fns": "^2.28.0",
"dom-lib": "^3.1.5",
"font-awesome": "^4.7.0",
"history": "5.0.0",
"jquery": "^3.6.0",
"json-schema-to-typescript": "^11.0.2",
"lib": "^4.3.3",
"material-ui-dropzone": "^3.5.0",
"moment": "^2.29.3",
"node": "^16.13.0",
"notistack": "^1.0.10",
"perfect-scrollbar": "1.5.1",
"popper.js": "^1.16.1",
"prop-types": "15.7.2",
"react": "^18.2.0",
"react-chartist": "0.14.4",
"react-dom": "17.0.2",
"react-image-gallery": "^1.2.8",
"react-moment": "^1.1.2",
"react-redux": "^7.2.8",
"react-responsive-carousel": "^3.2.23",
"react-router-dom": "5.2.0",
"react-scripts": "^5.0.1",
"react-select": "^5.3.2",
"react-swipeable-views": "^0.14.0",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.1",
"styled-components": "^5.3.6"
},
"scripts": {
"lint": "eslint src",
"dev": "cross-env NODE_OPTIONS= next dev",
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
"lint:check": "eslint . --ext=js,jsx; exit 0",
"lint:fix": "eslint . --ext=js,jsx --fix; exit 0",
"build-package-css": "cp src/assets/css/material-dashboard-react.css dist/material-dashboard-react.css",
"build-package": "npm run build-package-css && babel src --out-dir dist"
},
"keywords": [],
"optionalDependencies": {
"#babel/core": "7.14.0",
"typescript": "4.2.4"
},
"devDependencies": {
"#babel/eslint-parser": "^7.19.1",
"#babel/preset-react": "^7.18.6",
"#craco/craco": "^7.0.0",
"autoprefixer": "^10.4.13",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"gulp": "4.0.2",
"gulp-append-prepend": "1.0.9",
"postcss": "^8.4.21",
"react-error-overlay": "6.0.9",
"tailwindcss": "npm:#tailwindcss/postcss7-compat#^2.2.17"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": []
},
"resolutions": {
"react-error-overlay": "6.0.9"
}
}
I have tried to upgrade my react-scripts by using
npm ugdate react-scripts
npm upgrade react-scripts
yarn update react-scripts
yarn upgrade react-scripts
But no changes were applied :(

requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager

How to fix this error requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager. in windows pc i have tried #Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
} but it didnt work and also tried .\gradlew clean both are not working in my case than how to fix it>
my package.json
{
"name": "letschat",
"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 ."
},
"dependencies": {
"#react-navigation/bottom-tabs": "^6.3.3",
"#react-navigation/native": "^6.0.12",
"#react-navigation/native-stack": "^6.8.0",
"react": "18.0.0",
"react-native": "0.69.5",
"react-native-safe-area-context": "^4.3.3",
"react-native-screens": "^3.17.0",
"socket.io-client": "^4.5.1"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.70.3",
"react-test-renderer": "18.0.0"
},
"jest": {
"preset": "react-native"
}
}
Kill Metro and clean gradle build (it might take a minute or two):
cd android
.\gradlew clean
Start Metro and clear cache:
npm start --reset-cache
Recompile
npm run android

React Native Version Mismatch even though the package.json has the right version

I am developing an expo app with react native. However I suddenly started encountering the following error [ check print ]
"React Native version mismatch.
JavaScript version: 0.63.3
Native version: 0.64.2"
This error however doesn't appear on my console, only on the emulator.
This is my packge.json file
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest --watchAll",
"updateAppSyncLayer": "amplify api gql-compile && amplify codegen && babel src/graphql --extensions \".ts\" --config-file ./compile.babel.config.json -d ./amplify/backend/function/outgoingappawsgraphqlQueriesLayer/opt/graphql/"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"#aws-amplify/core": "^4.2.9",
"#babel/preset-typescript": "^7.15.0",
"#expo-google-fonts/montserrat": "^0.1.0",
"#expo/vector-icons": "^12.0.0",
"#react-native-async-storage/async-storage": "~1.15.0",
"#react-native-community/datetimepicker": "3.5.2",
"#react-native-community/masked-view": "0.1.10",
"#react-native-community/netinfo": "6.0.2",
"#react-navigation/bottom-tabs": "^5.11.1",
"#react-navigation/native": "^5.8.9",
"#react-navigation/stack": "^5.12.6",
"#types/react-native-autocomplete-input": "^5.0.0",
"#types/react-native-check-box": "^2.1.2",
"#types/react-native-datepicker": "^1.7.1",
"#types/react-native-read-more-text": "^1.0.0",
"#types/uuid": "^8.3.1",
"aws-amplify": "^4.2.9",
"aws-amplify-react-native": "^5.0.3",
"expo": "^43.0.0",
"expo-app-loading": "~1.2.1",
"expo-barcode-scanner": "~11.1.2",
"expo-contacts": "~10.0.3",
"formik": "^2.2.6",
"moment": "^2.29.1",
"react": "17.0.1",
"react-native": "0.63.3",
"react-native-autocomplete-dropdown": "^1.1.4",
"react-native-autocomplete-input": "^5.0.2",
"react-native-check-box": "^2.1.7",
"react-native-datepicker": "^1.7.2",
"react-native-dropdown-picker": "^5.1.21",
"react-native-gesture-handler": "~1.10.2",
"react-native-multiple-select": "^0.5.7",
"react-native-paper": "^4.8.1",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-svg": "^6.1.1",
"react-native-read-more-text": "^1.1.2",
"react-native-safe-area": "^0.5.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "~3.8.0",
"react-native-svg": "12.1.1",
"uuid": "^8.3.2",
"yup": "^0.32.9"
},
"devDependencies": {
"#babel/cli": "^7.15.4",
"#babel/core": "^7.12.9",
"#babel/preset-env": "^7.15.6",
"#types/react": "~17.0.21",
"#types/react-native": "0.63.3",
"jest-expo": "^43.0.0",
"typescript": "~4.3.5"
},
"private": true
}
As you can see I have already set my react-native package to 0.63.3, uninstalled and reinstalled node-modules but I still get the error message.
What can I do?

Bundle error after upgrading Expo to SDK 42

I upgraded expo from sdk 39 to sdk 42 and I've got bundle error
Unable to resolve module ./TransitionProgressContext from E:\reactNative\BooKing\node_modules\react-native-screens\src\index.native.tsx:
it shows error with react-native-screens. I have it in version 3.4.0
Package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#react-native-firebase/app": "^8.4.7",
"#react-native-firebase/auth": "^9.3.5",
"#react-navigation/bottom-tabs": "^5.4.4",
"#react-navigation/native": "^5.3.2",
"#react-navigation/native-stack": "^6.1.0",
"#react-navigation/stack": "^5.3.5",
"expo": "^42.0.0",
"expo-app-loading": "^1.1.2",
"expo-barcode-scanner": "^10.2.2",
"expo-camera": "~11.2.2",
"expo-permissions": "^12.1.1",
"expo-status-bar": "^1.0.4",
"firebase": "^8.2.3",
"lottie-react-native": "~2.6.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
"react-native-camera": "^3.43.0",
"react-native-gl-model-view": "^1.6.0",
"react-native-safe-area-context": "3.1.4",
"react-native-safe-module": "^1.2.0",
"react-native-screens": "~3.4.0",
"react-native-web": "~0.13.7",
"react-router-native": "^5.2.0",
"tcomb-form-native": "^0.6.20",
"unimodules-permissions-interface": "^6.1.0"
},
"devDependencies": {
"#babel/core": "~7.9.0"
},
"private": true
}
How to fix this problem? I don't know why it's appearing.
Problem solved. I needed just to clear cache with command expo r -c

EISDIR after adding React Navigation to the project

I added react navigation to my project. I installed it like it is written in their docs, but it tells me:
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:577:3)
at tryReadSync (fs.js:353:20)
at Object.readFileSync (fs.js:390:19)
at UnableToResolveError.buildCodeFrameMessage (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:347:17)
at new UnableToResolveError (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:333:35)
at ModuleResolver.resolveDependency (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:211:15)
at DependencyGraph.resolveDependency (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
at /Users/administrator/globo/node_modules/metro/src/lib/transformHelpers.js:317:42
at /Users/administrator/globo/node_modules/metro/src/Server.js:1471:14
at Generator.next (<anonymous>)
Here is my package.json:
{
"main": "index.js",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "expo start -c",
"test": "jest"
},
"dependencies": {
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.4",
"expo": "~40.0.0",
"expo-splash-screen": "~0.8.0",
"expo-status-bar": "~1.0.3",
"expo-updates": "~0.4.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "^0.64.0",
"react-native-gesture-handler": "~1.8.0",
"react-native-reanimated": "~1.13.0",
"react-native-screens": "~2.15.0",
"react-native-unimodules": "^0.13.0",
"react-native-web": "^0.15.0"
},
"devDependencies": {
"#babel/core": "~7.9.0",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.13.1"
},
"jest": {
"preset": "react-native"
},
"private": true
}
I don't know what should I add, so please ask questions if you need. Please help. I am new in React Native.

Categories