zamotany / module-federation-repack

38 stars 12 forks source link

ChunkManager.loadChunk invocation failed: Failed to connect to localhost/127.0.0.1:9000 #11

Closed n6fab closed 2 years ago

n6fab commented 2 years ago

What's wrong? I chose a Pixel 2 API 30 as the emulator. My node js version is 16.14.2 I don't understand how to solve, here are the steps:

From each terminal for app1, app2 and host: yarn install

Next I launched: yarn --cwd app1 start yarn --cwd app2 start yarn --cwd host start

While they were running I launched from a fourth terminal: yarn --cwd host android

when the host build finished it gives some errors, including:

ChunkManager.loadChunk invocation failed: Failed to connect to localhost/127.0.0.1:9000 [NetworkFailure] 

I report everything below:

D:\Projects\module-federation-repack\host>yarn` --cwd host start
yarn run v1.22.19
warning ..\..\package.json: No license field
$ react-native webpack-start
i [16:11:15.545Z][DevServerProxy] Server listening at http://[::]:8081
i [16:11:15.549Z][DevServerProxy] Dashboard available at: http://localhost:8081/dashboard
i [16:19:45.208Z][DevServerProxy] Hermes device connected { deviceId: 0 }
i [16:19:49.731Z][DevServerProxy] Starting compiler worker { platform: 'android', port: 49923 }
i [16:22:01.710Z][DevServerProxy] fetching from remote server {
  source: 'http://localhost:49923/index.bundle?platform=android&dev=true&minify=false&app=com.hostmfr&modulesOnly=false&runModule=true'
}
i [16:22:01.435Z][DevServer@android] Server listening at http://[::]:49923
i [16:22:01.577Z][DevServerPlugin] Successfully run: C:\Users\username\AppData\Local\Android\sdk/platform-tools/adb reverse tcp:49923 tcp:49923
i [16:22:07.457Z][webpack-dev-middleware] wait until bundle finished: /index.bundle?platform=android&dev=true&minify=false&app=com.hostmfr&modulesOnly=false&runModule=true
x [16:22:09.058Z][DevServerProxy] Cannot parse compiler worker message {
  platform: 'android',
  message: 'Browserslist: caniuse-lite is outdated. Please run:'
}
x [16:22:09.059Z][DevServerProxy] Cannot parse compiler worker message { platform: 'android', message: 'npx browserslist@latest --update-db' }
x [16:22:09.074Z][DevServerProxy] Cannot parse compiler worker message {
  platform: 'android',
  message: 'Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating'
}
i [16:23:30.172Z][LoggerPlugin] Bundle built with warnings { time: 88474 }
! [16:23:30.172Z][LoggerPlugin] Warning in "./node_modules/@react-navigation/elements/src/MaskedViewNative.tsx": Module not found: Error: Can't resolve '@react-native-masked-view/masked-view' in 'D:\Projects\module-federation-repack\host\node_modules\@react-navigation\elements\src'
i [16:23:31.245Z][DevServerProxy] response received
i [16:23:33.515Z][DevServerProxy] React Native client connected { clientId: 'client#0' }
i [16:23:34.755Z][Console] Running "HostMFR" with {"rootTag":1}
x [16:23:34.833Z][Console] ChunkManager.loadChunk invocation failed: Failed to connect to localhost/127.0.0.1:9000 [NetworkFailure] {"absolute": false, "body": undefined, "fetch": true, "headers": undefined, "method": "GET", "query": "platform=android", "timeout": 30000, "url": "http://localhost:9000/app1.container.bundle"}
i [16:23:35.188Z][DevServerProxy] fetching from remote server { source: 'http://localhost:49923/symbolicate' }
i [16:23:35.193Z][DevServerProxy] fetching from remote server { source: 'http://localhost:49923/symbolicate' }
x [16:23:35.213Z][Console] Unspecified error

This error is located at:
    in Lazy (at Root.js:65)
    in Suspense (at Root.js:62)
    in App1Wrapper (at SceneView.tsx:126)
    in StaticContainer
    in EnsureSingleNavigator (at SceneView.tsx:118)
    in SceneView (at useDescriptors.tsx:209)
    in RCTView (at View.js:32)
    in View (at Screen.tsx:63)
    in RCTView (at View.js:32)
    in View (at Background.tsx:13)
    in Background (at Screen.tsx:58)
    in Screen (at BottomTabView.tsx:129)
    in RNSScreen (at createAnimatedComponent.js:243)
    in AnimatedComponent (at createAnimatedComponent.js:296)
    in AnimatedComponentWrapper (at src/index.native.tsx:171)
    in Screen (at ScreenFallback.tsx:37)
    in MaybeScreen (at BottomTabView.tsx:122)
    in RNSScreenContainer (at src/index.native.tsx:238)
    in ScreenContainer (at ScreenFallback.tsx:28)
    in MaybeScreenContainer (at BottomTabView.tsx:93)
    in RNCSafeAreaProvider (at SafeAreaContext.tsx:76)
    in SafeAreaProvider (at SafeAreaProviderCompat.tsx:46)
    in SafeAreaProviderCompat (at BottomTabView.tsx:92)
    in BottomTabView (at createBottomTabNavigator.tsx:112)
    in Unknown (at createBottomTabNavigator.tsx:111)
    in BottomTabNavigator (at Root.js:86)
    in EnsureSingleNavigator (at BaseNavigationContainer.tsx:430)
    in BaseNavigationContainer (at NavigationContainer.tsx:132)
    in ThemeProvider (at NavigationContainer.tsx:131)
    in NavigationContainerInner (at Root.js:84)
    in Root (at renderApplication.js:48)
    in RCTView (at View.js:32)
    in View (at AppContainer.js:106)
    in RCTView (at View.js:32)
    in View (at AppContainer.js:133)
    in AppContainer (at renderApplication.js:41)
    in HostMFR(RootComponent) (at renderApplication.js:57)
x [16:23:35.232Z][Console] [object Object]
i [16:23:35.234Z][DevServerProxy] fetching from remote server { source: 'http://localhost:49923/symbolicate' }
i [16:23:35.236Z][DevServerProxy] fetching from remote server { source: 'http://localhost:49923/symbolicate' }
i [16:23:35.242Z][DevServerProxy] fetching from remote server { source: 'http://localhost:49923/symbolicate' }
i [16:23:38.525Z][DevServerProxy] fetching from remote server {
  source: 'http://localhost:49923/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages/chevron-right.png?platform=android&hash=7aec4c2af0ff6ec47a438dac7b34ea2f'
}
i [16:23:38.534Z][DevServerProxy] response received
i [16:23:38.562Z][DevServerProxy] fetching from remote server {
  source: 'http://localhost:49923/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages/chevron-left.png?platform=android&hash=72631554a984080c9d9ea42d3b225e49'
}
i [16:23:38.566Z][DevServerProxy] fetching from remote server {
  source: 'http://localhost:49923/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages/loader.png?platform=android&hash=2de8fa9abc4f48e78c6d2c9e6503cd86'
}
i [16:23:38.635Z][DevServerProxy] response received
i [16:23:38.681Z][DevServerProxy] response received
x [16:23:44.589Z][DevServer@android] Failed to create code frame {
  error: "ENOENT: no such file or directory, open 'D:\\Projects\\module-federation-repack\\host\\host\\node_modules\\@babel\\runtime\\helpers\\construct.js?'"
}
i [16:23:44.614Z][DevServerProxy] response received
x [16:23:44.615Z][DevServer@android] Failed to create code frame {
  error: "ENOENT: no such file or directory, open 'D:\\Projects\\module-federation-repack\\host\\host\\node_modules\\@babel\\runtime\\helpers\\construct.js?'"
}
x [16:23:44.618Z][DevServer@android] Failed to create code frame {
  error: "ENOENT: no such file or directory, open 'D:\\Projects\\module-federation-repack\\host\\host\\node_modules\\@babel\\runtime\\helpers\\construct.js?'"
}
x [16:23:44.619Z][DevServer@android] Failed to create code frame {
  error: "ENOENT: no such file or directory, open 'D:\\Projects\\module-federation-repack\\host\\host\\node_modules\\@babel\\runtime\\helpers\\construct.js?'"
}
x [16:23:44.619Z][DevServer@android] Failed to create code frame {
  error: "ENOENT: no such file or directory, open 'D:\\Projects\\module-federation-repack\\host\\host\\node_modules\\@babel\\runtime\\helpers\\construct.js?'"
}
i [16:23:44.677Z][DevServerProxy] response received
i [16:23:44.680Z][DevServerProxy] response received
i [16:23:44.683Z][DevServerProxy] response received
i [16:23:44.686Z][DevServerProxy] response received
i [16:23:44.697Z][DevServerProxy] fetching from remote server { source: 'http://localhost:49923/symbolicate' }
x [16:23:44.870Z][DevServer@android] Failed to create code frame {
  error: "ENOENT: no such file or directory, open 'D:\\Projects\\module-federation-repack\\host\\host\\node_modules\\@babel\\runtime\\helpers\\construct.js?'"
}
i [16:23:44.874Z][DevServerProxy] response received
- Running...

Immagine 2022-06-29 185540

dsfdfd