callstack / super-app-showcase

Monorepository template for super app development with React Native and Re.Pack
MIT License
382 stars 63 forks source link

[ScriptManager] Failed while resolving script locator #53

Closed threeng0227 closed 11 months ago

threeng0227 commented 11 months ago

Ask your Question

I clone the source and run yarn run:host:android--> show error [ScriptManager] Failed while resolving script locator: {"caller": undefined, "scriptId": "auth"} {"originalError": [TypeError: Network request failed]}

image

Please help me! Thanks

thymikee commented 11 months ago

Did you run yarn start first?

threeng0227 commented 11 months ago

@thymikee I have run yarn start, but not working.

image image
thymikee commented 11 months ago

Can you post all the steps you did? You also need to run yarn adbreverse, maybe that's not super clear from the docs

threeng0227 commented 11 months ago

@thymikee All my steps:

yarn
yarn start
yarn adbreverse
yarn run:host:android

Show error

Screenshot 2023-07-12 at 16 23 44
jbroma commented 11 months ago

hey @nhoxx,

This is a connectivity problem between android emulator and your dev server

yarn adbreverse will do nothing unless the emulator is running, try running it after the emulator has started.

threeng0227 commented 11 months ago

Hi @jbroma @thymikee thanks for helping me. I will double-check to see if I missed any steps.

jbroma commented 11 months ago

@nhoxx any luck with resolving your issues?

threeng0227 commented 11 months ago

@jbroma I have stuck when building. http://localhost:9003auth.container.bundle not working, it looks like the auth module is having problems. I tried to solve it many times, but not working. So I used this example https://github.com/callstack/repack-examples .It working fine.

duyanhv commented 11 months ago

@jbroma I have stuck when building. http://localhost:9003auth.container.bundle not working, it looks like the auth module is having problems. I tried to solve it many times, but not working. So I used this example https://github.com/callstack/repack-examples .It working fine.

same, i ran "yarn concurrently -P "yarn start:catalog" "yarn start:auth"" to see what's wrong with auth, it got something to do with repack not bundling correctly, i checked the generated/ios folder there's only: node_modules_react-native-async-storage_async-storage_src_index_ts.chunk.bundle not vendors-node_modules_react-native-async-storage_async-storage_src_index_ts.chunk.bundle. Error: ENOENT: no such file or directory, open '/Users/superapp/super-app-showcase/packages/auth/build/generated/ios/vendors-node_modules_react-native-async-storage_async-storage_src_index_ts.chunk.bundle'

after changing the name to vendors-node_modules_react-native-async-storage_async-storage_src_index_ts.chunk.bundle. i got another error. Error: ENOENT: no such file or directory, open '/Users/superapp/super-app-showcase/packages/auth/build/generated/ios/vendors-node_modules_pmmmwh_react-refresh-webpack-plugin_lib_runtime_RefreshUtils_js.chunk.bundle' i think the error might be in the repack configuration.

threeng0227 commented 11 months ago

Hi @duyanhv, You can see this example: https://github.com/callstack/repack-examples. I tried and working fine.

duyanhv commented 11 months ago

for anyone who's still searching for the answer: comment the line verifyScriptSignature: 'strict' in /host/index.js comment all new Repack.plugins.CodeSigningPlugin in webpack.config.mjs

trancongdung12 commented 11 months ago

@duyanhv thanks bro. it's work find with me

trancongdung12 commented 11 months ago

@nhoxx Can you give me step run ios pls?

threeng0227 commented 11 months ago

@trancongdung12 what problems do you have during the ios build process?

trancongdung12 commented 11 months ago

@nhoxx https://github.com/callstack/super-app-showcase/issues/54 this is my issue.

threeng0227 commented 11 months ago

@nhoxx #54 this is my issue.

Did you run yarn pods ?

trancongdung12 commented 11 months ago

@nhoxx I try yarn pods but it still has an error. error: Unable to load contents of file list: '/Target Support Files/Pods-host/Pods-host-resources-Debug-input-files.xcfilelist' (in target 'host' from project 'host')

mahendramahi commented 2 weeks ago

This is adb connectivity problem So use adb reverse command when it come and reload app with all port's number which is using for your host and mini modules. Like:-
adb reverse tcp:3000 tcp:3000 && adb reverse tcp:8081 tcp:8081 && adb reverse tcp:9000 tcp:9000 && adb reverse tcp:9001 tcp:9001 && adb reverse tcp:9002 tcp:9002 && adb reverse tcp:9003 tcp:9003