repack icon indicating copy to clipboard operation
repack copied to clipboard

Stuck while loading bundles on second app launch with cache flag enabled

Open hafiz-azman-cd opened this issue 1 year ago • 0 comments

Environment

Localhost dev

Description

Hello I've tried to enable caching in my project following the caching and versioning guide. The app runs with all the remotes loaded and working the first time I launch it. However, if I close the app and launch it again, it gets stuck at the launch screen.

I initially thought it was an issue with the project code, but the same problem occurs when I try it with the sample project super-app-showcase.

image

I've tried to debug and it seems like it stuck at Federated.importModule().

I didn't get this issue if I set the cache flag to false, but then the app downloads the remote bundles every time I need to access them, which is not optimal.

Reproducible Demo

  1. Clone and setup super-app-showcase

  2. In packages/booking/index.js packages/dashboard/index.js packages/host/index.js packages/shell/index.js packages/shopping/index.js

    Add

    import AsyncStorage from '@react-native-async-storage/async-storage';
    
    ...
    
    ScriptManager.shared.setStorage(AsyncStorage);
    
    ...
    

    and set cache: true

hafiz-azman-cd avatar Jul 03 '24 06:07 hafiz-azman-cd