Unable to resolve "expo-asset" after update to Expo 33.0.0

Hello,
after upgrading to expo 33.0.0, following the guide https://blog.expo.io/expo-sdk-v33-0-0-is-now-available-52d1c99dfe4c, when i run npm start and scan the qrcode to launch Expo Cli on my iphone i get the following error during the build process:

Unable to resolve “expo-asset” from "node_modules/expo-av/build/AV.js"

And it cannot build the project.

Is there something else i need to update? Does anyone got this error and solved?
Thank you

Ve

Hey @ve9,

Can you try running expo install expo-asset in your project?

Cheers,
Adam

1 Like

EDIT:
i change every import {Constants} from “expo-constants” into import Constants from “expo-constants” and this seems to work

now i’m facing a problem with ionicons: fontFamily “ionicons” is not a system font and has not been loaded through Font.loadAsync.


Hi @adamjnav thanks for your support.
I installed expo-asset and also:

  • updated “@expo/vector-icons” to version “10.0.1”
  • installed expo-constants
  • installed expo-file-system
  • installed expo-font
  • installed react-native-vector-icons
  • add “metro” version “^0.54.1” to the devDependencies

And only now it is able to compile.

After updating the import changing things as import {Constants} from “expo” into import {Constants} from “expo-constants” i get the following error:

_expoConstants.Constants.statusBarHeight undefined

Is all this procedure right?
I mean, the blog instructions didn’t say anything about all this updates i made… and still it doesn’t even work…

Thanks for the help

1 Like

Hey @ve9,

You mention the proper import statement above but later in your post you refer to an incorrect one (import {Constants} from 'expo-constants') Can you make sure the import statement in your code is import Constants from 'expo-constants';

Hey @adamjnav
yes i corrected it as you can see in the EDIT of the previous messages.

Now i’m stuck with this error: fontFamily “ionicons” is not a system font and has not been loaded through Font.loadAsync.

this is my app.js at the moment:

...
import {AppLoading} from "expo";
import * as Font from 'expo-font'
import Constants from "expo-constants"
...

const AvenirBook = require("./fonts/Avenir-Book.ttf");
const AvenirLight = require("./fonts/Avenir-Light.ttf");
const Ionicons = require("./fonts/Ionicons.ttf");

export default class App extends React.Component<{}, AppState> {
    componentDidMount() {
        const promises = [];
        promises.push(Font.loadAsync({
            "Avenir-Book": AvenirBook,
            "Avenir-Light": AvenirLight,
            "Ionicons": Ionicons,
        }));
    }


    render(): React.Node {
        const {ready} = this.state;
        return (
                  ...
                        {
                            ready
                                ?
                                (
                                    <React.Fragment>
                                        <StatusBar barStyle="dark-content" backgroundColor="transparent" translucent />
                                        <AppContainer onNavigationStateChange={() => undefined} />
                                    </React.Fragment>
                                )
                                :
                                (
                                    <AppLoading startAsync={null} onError={null} onFinish={null} />
                                )
                        }
               ...
        );
    }
}

...
const AppContainer = createAppContainer(AppNavigator)
export {AppContainer};

I really cannot solve this issue

Thanks

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