Skip to content
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

Unable to load script. #9

Open
shakeelkoper opened this issue Aug 5, 2024 · 7 comments
Open

Unable to load script. #9

shakeelkoper opened this issue Aug 5, 2024 · 7 comments

Comments

@shakeelkoper
Copy link

Environment

node -v v20.15.1
"react-native": "^0.72.3",

Description

image

After Cloning Project
yarn install
yarn start
yarn run:host-app:android
getting below error:
Unable to load script. make sure you're either running metro(run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release

Reproducible Demo

image
@jbroma
Copy link
Member

jbroma commented Aug 5, 2024

Hi @shakeelkoper,

please try starting the host app with yarn react-native start --host 127.0.0.1 - the super app example was updated to V4 yet and this was one of the things we've fixed there.

@shakeelkoper
Copy link
Author

Really Appreciate and Thanks for the Quick Reply
Steps:
Terminal 1: yarn start
image

Terminal 2: From Root Folder Navigating to cd packages/host-app and running yarn react-native start --host 127.0.0.1
able to run ios
image

but again for only android getting
image
image
image

@jbroma

@jbroma
Copy link
Member

jbroma commented Aug 6, 2024

@shakeelkoper please use react-native webpack-start --host 127.0.0.1

@shakeelkoper
Copy link
Author

after adding "start": "react-native webpack-start --host 127.0.0.1", in package.json host file
and then running
Steps(Running both the command on the root folder):
Terminal 1: yarn start
Terminal 2: yarn run:host-app:android
I am able to run the App but when I click on Navigate to Mini App Button Getting below Error
image
@jbroma

@shakeelkoper
Copy link
Author

shakeelkoper commented Aug 7, 2024

@jbroma
I have gone through multiple tickets raised on repack repo
callstack/repack#429
callstack/repack#250
and was able to understand that I have to run adb reverse for mini app once it is started and I have done the same
image
but still I am getting same error where I am not able to navigate to mini app and throws below error
image
I also have the doubt why the identifiers for the adb reverse list is same but I am not able to wrap my head around it
on my machine I am able to run HOST:->http://127.0.0.1:8081 and MINI->http://127.0.0.1:9000 on chrome browser
but on emulator chrome I am only able to run http://127.0.0.1:8081 for http://127.0.0.1:9000 it is showing site is not reachable
This issue is only happening for android simulator not for ios can you please help I have also upgraded to repack 4.1.1 still issue persist

@jbroma
Copy link
Member

jbroma commented Aug 7, 2024

@shakeelkoper please also run the mini-app server with --host 127.0.0.1 - it's most likely the same issue. After upgrading it shouldnt be needed but maybe your forgot the adb reverse part? Kudos for finding this stuff out anyways!

@shakeelkoper
Copy link
Author

@jbroma sorry to bother so much but repack has a great community and I appreciate your help very much. towards the community you guys are really doing charity
If you check below even after adding adb reverse
image
and I am still getting the same error
image
below I have also shared the logs for yarn start
image
do I need to make changes to packages/mini-app/webpack.config.mjs @ Repack.plugins.ModuleFederationPlugin as you have mentioned in callstack/repack#626
host-app->package.json->"start": "react-native webpack-start --host 127.0.0.1",
mini-app->package.json->"start": "react-native webpack-start --host 127.0.0.1 --port 9001",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants