repack icon indicating copy to clipboard operation
repack copied to clipboard

Module Federation host app not working [ScriptManager] failed to load script : [NetworkFailure]

Open anuragarwalkar opened this issue 1 year ago • 2 comments

Environment

M1 Pro Xcode 15.4

"react-native": "0.74.1", "@callstack/repack": "4.0.0", "node: 20"

Issue

I am trying to run the module federation example from the Re.pack examples repository but encountering issues with the script manager failing to load. Despite creating new React Native apps and following all necessary configuration steps outlined on the Re.pack website, the module federation is not operational. Even after referring to the example apps, I am unable to get module federation up and running.

image

Reproducible Demo

https://github.com/anuragarwalkar/repack-module-federation

  1. clone repack-module-federation
  2. install all the dependencies
  3. now run the app

host app error

image

[ScriptManager] Failed to load script: [NetworkFailure] {"cache": false, "caller": undefined, "locator": {"absolute": false, "body": undefined, "fetch": true, "headers": undefined, "method": "GET", "query": "platform=android", "timeout": 30000, "url": "http://localhost:9000/app1.container.bundle", "verifyScriptSignature": "off"}, "scriptId": "app1"} {"originalError": [Error: Failed to connect to localhost/127.0.0.1:9000]}

App1 devServer error

image

Additional Information

Re.pack Version: 3.3.0 (tried with 4.0) React Native Version: 0.68.2 Platform: ios/Android Node Version: 18.2 Operating System: MacOs Sonoma 14.5

anuragarwalkar avatar May 23 '24 13:05 anuragarwalkar