Open IamJignesh opened 2 months ago
On debugging it further I found that the issue is with react-native bundler, by running the following commands in isolation I can reproduce the issue:
To workaround this issue, Firstly I am creating the following directory: C:\Users\{userName}\Desktop\myapp\windows\myapp\Bundle\assets\node_modules\react-native-windows\Libraries\NewAppScreen\components
and than running: npx react-native run-windows --arch x64 --release --logging
After adding the above workaround, the build no longer get's stuck at the "Done copying assets" step
I've seen this happen before but never consistently - something in Metro is obviously blocked when creating the bundle and copying the assets (maybe making the new folders is part of it) - unfortunately we don't know what folders to make independent of metro's bundling.
Problem Description
React Native windows Release build stuck at "Done copying assets"
When a new React Native Windows project is created and the release build is run, it gets stuck at "Done copying assets" and does not proceed further.
This only happens on the first release build. Subsequent release builds work fine.
This is creating a problem for CI/CD pipelines where release build is stuck as it is the first build every time a new build is triggered.
When running locally, when the build gets stuck at Done copying assets, terminating the build (Ctrl+C) and running the release build again works fine.
Here are my full build logs: build.log
Steps To Reproduce
Build hangs when running the above steps:
Expected Results
The app builds successfully the first time.
CLI version
14.0.0
Environment
Community Modules
{ "name": "myapp", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest", "windows": "react-native run-windows", "test:windows": "jest --config jest.config.windows.js" }, "dependencies": { "react": "18.3.1", "react-native": "0.75.2", "react-native-windows": "latest" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.75.2", "@react-native/eslint-config": "0.75.2", "@react-native/metro-config": "0.75.2", "@react-native/typescript-config": "0.75.2", "@rnx-kit/jest-preset": "^0.1.17", "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.3.1", "typescript": "5.0.4" }, "engines": { "node": ">=18" }, "packageManager": "yarn@3.6.4" }
Target Platform Version
10.0.22321
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Release
Snack, code example, screenshot, or link to a repository
No response