callstack / repack

A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem.
https://re-pack.dev
MIT License
1.49k stars 110 forks source link

Repack not working with latest react native version 0.75.2 #709

Closed rakesh200023 closed 3 months ago

rakesh200023 commented 3 months ago

Describe the bug

I am just starting a new project and downloaded the latest react native template from official website and i used the "npx @callstack/repack-init" command and it successfully set up the repack configuration. However when trying to run the app, I'm getting the following below error. I can see the build is successful but I'm guessing there might me some compatibility issues with new version of RN.

i [10:11:09.515Z][DevServer] Server listening at http://[::1]:8081 i [10:11:09.518Z][DevServer] Server listening at http://127.0.0.1:8081 i [10:11:16.124Z][DevServer] GET 200 /status request completed { responseTime: 3.9408000707626343 } -> [10:11:17.233Z][LoggerPlugin] Compiling android: 3% setup (watch run) i [10:11:17.271Z][DevServer] Successfully run: C:\Users\rakes\AppData\Local\Android\Sdk/platform-tools/adb reverse tcp:8081 tcp:8081 -> [10:11:18.841Z][LoggerPlugin] Compiling android: 23% building (2/8 entries 118/181 dependencies 9/87 modules) -> [10:11:20.698Z][LoggerPlugin] Compiling android: 30% building (3/8 entries 730/839 dependencies 101/250 modules) -> [10:11:22.241Z][LoggerPlugin] Compiling android: 30% building (3/8 entries 1413/1460 dependencies 167/409 modules) -> [10:11:25.192Z][LoggerPlugin] Compiling android: 30% building (3/8 entries 1600/1683 dependencies 219/436 modules) -> [10:11:26.946Z][LoggerPlugin] Compiling android: 30% building (3/8 entries 2223/2300 dependencies 334/576 modules) -> [10:11:28.601Z][LoggerPlugin] Compiling android: 65% building i [10:11:29.599Z][DevServer] GET 200 /index.bundle?platform=android&dev=true&lazy=true&minify=false&app=com.myremote&modulesOnly=false&runModule=true request completed { responseTime: 13256.02059996128 } x [10:11:29.511Z][LoggerPlugin] Failed to build bundle due to errors x [10:11:29.511Z][LoggerPlugin] Error in "./nodemodules/@callstack/repack/dist/modules/WebpackHMRClient.js": Module not ### ### found: Error: Can't resolve 'react-native/Libraries/Utilities/LoadingView' in 'C:\Users\rakes\react-native-cli\myRemote\nodemodules\@callstack\repack\dist\modules' i [10:11:30.220Z][DevServer] React Native client connected { clientId: 'client#0' } i [10:11:30.343Z][DevServer] React Native client disconnected { clientId: 'client#0' } -> [10:11:29.558Z][LoggerPlugin] Compiling android: 100%

System Info

System:
  OS: Windows 11 10.0.22631
  CPU: "(16) x64 AMD Ryzen 7 6800H with Radeon Graphics         "
  Memory: 2.34 GB / 15.19 GB
Binaries:
  Node:
    version: 20.13.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 3.6.4
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "34"
      - "35"
    Build Tools:
      - 34.0.0
      - 35.0.0
    System Images:
      - android-35 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK:
    AllowAllTrustedApps: Disabled
IDEs:
  Android Studio: AI-241.15989.150.2411.11948838
  Visual Studio: Not Found
Languages:
  Java: 17.0.11
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.2
    wanted: 0.75.2
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Re.Pack Version

4.2.0

Reproduction

https://github.com/rakesh200023/myRemote

Steps to reproduce

Run "npm install" and then run "npm run android". Hopefully the build will be successful but the error will be thrown during the app launch

jbroma commented 3 months ago

Hi @rakesh200023,

this was fixed in https://github.com/callstack/repack/pull/703 - new version 4.3.0 with a fix will be released tomorrow. Closing since it's not relevant anymore.