-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bundling mini-apps cause crashes #619
Comments
please try upgrading to can you show some logs where the error occurs? The logs you've provided just show the bundling progress. |
Hi @jbroma i upgraded to 4.0.0 still having the bundling crash, i dont received any errors, on the mini-app console, heres the completed logs for mini-app.. yarn start:mini-app |
for the host this is what i get.. [15:25:01.577Z][DevServer] GET 200 /index.bundle?platform=android&dev=true&minify=false&app=com.landersph.mobile_dev&modulesOnly=false&runModule=true request completed { responseTime: 69268.266779989 } This error is located at: This error is located at: |
@jbroma additional info, it only happens on 1st load, but when the mini-app is already bundle to 100% it will work, but the apk/ipa when you open it, it crash.. hope this info helps.. maybe its regarding to timeout on the bundling mini-app? and if ever do i need to extend it or how? this is how i render my mini-app `const HomeBanners = React.lazy(() => <React.Suspense |
@keithlimmontajes did you declare |
Yes, this is my host config new Repack.plugins.ModuleFederationPlugin({ |
It's also weird that it looks to load |
is reanimated also declared as shared in your mini app config? |
yes, this is for the mini-app shared: {
|
Could you please share a full repo with your setup? I'm afraid I won't be able to help without seeing the whole setup |
@jbroma what email i could use for you? ill add you as a collaborator, sorry its a client project, i cant public :( j.romanczyk@gmail.com |
@keithlimmontajes Please try to create a minimal reproduction that's publicly available - I won't be able to help you with a private project - you can contact our sales team (jakub.stadniczuk@callstack.com) to inquire about such arrangements |
got it, ill make a minimal reproduction publicly available. Thanks .. |
note: this is unrelated to the issue above, and still needs a valid repro |
Hi @jbroma here's a public repo.. i tested it on android its working and have the same error encounter. Thanks.. |
Let me know if you still need more info.. Thanks thanks |
@keithlimmontajes I see the repro is quite large in size, could you please provide some steps to reproduce? Also by default the repo uses yarn PnP mode which def won't work with RN |
@keithlimmontajes any update on this? |
Environment
MAC i7 Core Intel
Xcode 15
Android Studio
"react-native": "0.72.11",
"@callstack/repack": "3.7.0",
"node: 18.2"
Description
I have a react native app, using callstack, based on the https://github.com/callstack/super-app-showcase/tree/main, We created a Host-app and a mini-app, now the issue is, my Mini-app is taking too long to bundling locally even the deployed server, there is crashing after a minute when the bundling is 32% on the mini-app...
is there's a way to extend the timeout for bundling the mini-app or missconfig on my end here attached the files and errors encounter:
host-app -> index.js
host-app.webpack.config.mjs.zip
package.json.zip
webpack.config.mjs.zip
// Define containers URL
let containers = {
Landers:
${CONFIG.LANDERS_CONTAINER_URL}/[name][ext]
,};
// Create URL resolver
let resolveURL = Federated.createURLResolver({
containers,
});
// Add resolver to ScriptManager
ScriptManager.shared.addResolver(async (scriptId, caller) => {
try {
// Implement timeout logic here
const timeoutDuration = 120000; // 2 minutes in milliseconds
} catch (error) {
console.error('Error loading script:', error);
return undefined;
}
});
// Helper function to fetch script with retries
async function fetchScript(scriptId, caller) {
// Your existing script fetching logic goes here
let url;
if (caller === 'main') {
url = Script.getDevServerURL(scriptId);
} else {
url = resolveURL(scriptId, caller);
}
if (!url) return undefined;
const response = await fetch(url);
if (!response.ok) {
throw new Error(
Failed to load script: ${response.status} ${response.statusText}
,);
}
console.log('====================== !!!!!!', url);
if (Platform.OS === 'android') {
if (scriptId === 'Landers') {
url =
${url}?platform=${Platform.OS}
;}
}
const scriptContent = await response.text();
return {
url,
content: scriptContent,
};
}
// Register the app component
AppRegistry.registerComponent(appName, () => App);
Reproducible Demo
host yarn "start": "react-native webpack-start --resetCache"
mini-app yarn "start": "react-native webpack-start --port 9001 --resetCache",
The text was updated successfully, but these errors were encountered: