Unable to resolve "expo-app-loading" from "App.js"

I am getting this error:

Failed building JavaScript bundle.
Unable to resolve “expo-app-loading” from “App.js”

when I ran my project after a couple of months. Earlier it was working fine but not now.
Can someone please help me out?

Hey @aayushpatniya, can you make sure you have your node_modules properly installed as well as the expo-app-loading package specifically?

Cheers,
Adam

Hi @adamjnav, thank you for your response.
Yes, I have already deleted and reinstalled node modules.
And about “expo-app-loading” , I guess the package name have changed to “expo” in the new version,but have tried that too, still not working.

do you have expo-app-loading in your package.json? it seems that you do not

Yeah thanks, It was not there. I installed it to get it included in the package.json and the error is gone. But having another error now :

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

I am not able to identify from where this error is coming.

Thanks all,
I got my app running. The error was I was importing AppLoading the wrong way. I wrote-
import {AppLoading} from ‘expo-app-loading’;
replacing it with -
import AppLoading from ‘expo-app-loading’;
resolved the issue.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.