get userPackagerOpts.sourceExts is not iterable while runing the expo app - react-native

I am getting the following error while runing the expo app.
$ expo-cli start --tunnel
[00:24:51] Starting project at C:\Users\DEMO\Desktop\worldsweets
[00:24:51] Expo DevTools is running at http://localhost:19002
[00:24:59] userPackagerOpts.sourceExts is not iterable
[00:24:59] TypeError: userPackagerOpts.sourceExts is not iterable
at startReactNativeServerAsync (C:\#expo\xdl#57.9.12\src\Project.ts:1788:80)
at Object.startAsync (C:\#expo\xdl#57.9.12\src\Project.ts:2407:5)
at action (C:\Users\DEMO\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:181:3)
at C:\Users\DEMO\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:354:16
at Command.<anonymous> (C:\Users\DEMO\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:80:7)

I believe this is an old bug that has been reintroduced in expo-cli v3.21.2 or v3.21.3. I am using expo-cli v3.21.3 and ran into this issue too.
This post on the expo forum suggested adding "sourceExts": ["js", "jsx", "svg", "svgx"] to your app.json under packagerOpts and worked to get my project running again.
app.json
"packagerOpts": {
"assetExts": ["ttf"],
"sourceExts": ["js", "jsx", "svg", "svgx"]
}

Update the expo-cli version to 3.17.10.
This new version seems to fix this issue.
npm install expo-cli#3.17.10 --save
Related question: https://forums.expo.io/t/userpackageropts-sourceexts-is-not-iterable/35271/4

You just need to update your expo-cli
Run this command
npm install -g expo-cli
Problem Solved

Related

Expo fails to build, Request failed with status code 400

I'm trying to build a project in expo react native project.
My expo version is 3.2.2, sdkVersion is 35.
When I ran in cmd (on Windows 10)
set EXPO_DEBUG=true
expo build:android -c
I got:
Request failed with status code 400
Error: Request failed with status code 400
at createError (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\adapters\http.js:237:11)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I'm tried to update expo version, sdkVersion, the version in react, check for internet connection.
Expo login and logout works fine. I don't have any proxy in my network.
I don't have any clues for what search or how to fix this problem.
Seems was a error in expo-cli version 3.2.2.
The update 3.2.3 fixed for me.
I have fixed the issue by using this command
Move to your root folder then type this command in your terminal
npm install -g expo-cli
I had two versions of expo-cli installed (one via yarn global install expo-cli and one as a dev dependency in project yarn add -D expo-cli). This started working for me after I removed the global expo-cli:
yarn global remove expo-cli
and used the local version in my project instead:
yarn run expo-cli start
Run those following command, then we are good to go.
$ yarn global remove expo-cli && yarn global add expo-cli
$ rm -rf node_modules/ yarn.lock && yarn install
$ yarn run start

Cannot find module 'expo/bundleNativeModules.json'

I'm using expo to build an app. I'm new to React-Native and expo so if you could help me, I'd be really appreciated.
I get a couple of warnings that says:
Some of your project's dependencies are not compatible with currently installed expo package version
- expo-constants - expected version range: ...
- expo-permissions - expected version range: ...
- react-native-gesture-handler - expected version range: ...
Your project may not work correctly until you install the correct versions of the packages.
I was facing another error:
"TypeError: TypeError: undefined is not an object (evaluating '_styles.default.list')".
So I'm trying to install the latest version.
When I try to install expo install expo-permissions and expo install react-native-gesture-handler, I get errors.
Both errors say
Cannot find module 'expo/bundledNativeModules.json'
Require stack:
- /Users/address/src/react-native-udacicards/noop.js
I tried to remove node_modules and package-lock.json then npm install.
rollback with npm install -g expo-cli#2.4.3
I don't know if this solution will work for all the situations, but this is what fixed the issue it for me:
clean the npm cache using the following command : npm cache clean --force
re-install the dependencies : npm install
expo install
I hope it helps
1.on your package.json change expo version to
"expo": "~43.0.2", (or lower)
and your react-native-gesture-handler to
"react-native-gesture-handler": "~1.10.2",
(for expo 43.0.2)
Then, on your terminal (in your project), run
npm cache clean --force
npm install
expo doctor --fix-dependencies
I also faced this issue but Enableing USB tethering in phone, and clearing all data in expo app resolved this issue.

React Native Accessing view manager configs directly off UIManager via UIManager['AIRMap'] is no longer supported

I'm getting the following warning "Accessing view manager configs directly off UIManager via UIManager['AIRMap'] is no longer supported. Use UIManager.getViewManagerConfig('AIRMap') instead". Its been showing since I have installed the react-native-maps package. Should I ignore it or its there a solution for it?
Thanks in advance
This is fixed by downgrading "react-native-gesture-handler" to 1.3.0. You also need to clear the cache or you'll continue to see the warning.
Modify your package.json:
"react-native-gesture-handler": "~1.3.0"
Reinstall dependencies:
npm install or yarn install
Restart expo with a clear cache:
expo r -c
To hide the warning, downgrade react-native-gesture-handler to ‘1.3.0’.
yarn add react-native-gesture-handler#1.3.0
This appears to be a known issue with react-native 0.58 https://github.com/react-native-community/react-native-maps/issues/2620
This is for those who want a quick fix, here are some commands that you can run to fix it. Remember this solution is for expo users.
// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo#latest
// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json
// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler
// use expo to install the appropriate version
$ expo install react-native-gesture-handler
// start expo with a clean cache
$ expo start --clear
you need just downgrade react-native-gesture-handler to 1.3.0.
also You can do these steps:
directly change version in your package.json to ~1.3.0
run npm i or remove it and install through expo
sometimes it needs to clear cache of expo > expo r -c
If you are using expo, you can now use the command
expo install react-native-gesture-handler
This will make sure nothing breaks by installing react-native-gesture-handler in version 1.3.0 instead of 1.5.x.
There is a pretty recent issue on Github discussing this.

react native unable to run-android

I have followed guide here to setup react-native 0.23 https://facebook.github.io/react-native/docs/getting-started.html#content
I tried to run
react-native run-android
and got the following
Looks like you installed react-native globally, maybe you meant
react-native-cli? To fix the issue, run: npm uninstall -g react-native
npm install -g react-native-cli
and I tried above command to uninstall and install but still getting the samething.
I google and found some solution at Packager won't start
Tried:
"scripts": {
"start": "$NVM_BIN/react-native start"
}
and
react-native start
both still didn't work. For iOS no problem as I fired up XCode to run it. I have also installed VirtualBox and Genymotion as emulator.

react-native 0.1.5 TransformError: /path_to_app/index.ios.js Unknown plugin "node-env-inline"

I've just updated both watchman, homebrew and react-native-cli
The result is that all my new as well as old react-native applicationsare giving the same error.
It is a TransformError in index.ios.js
this is what i got in the simulator
I looked into this question:
[TransformError when running React Native Getting Started project (iOS)]
(TransformError when running React Native Getting Started project (iOS))
But, the answer did not worked for me.
i did :
rm -rf node_modules
npm cache clean
npm i
npm start
and it did not work.
Does any one know what is happening?
I ran into this issue as well. It appears to be a missing babel plugin. Run npm install babel-plugin-node-env-inline to fix. I also had to install babel-plugin-dunderscore-dev-inline.