react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

The bundle update stuck on Done copying asset.

Open nirajhi opened this issue 7 years ago • 11 comments

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

  1. appcenter codepush release-react -a <username/app-name> -d Production -p "./ios/app/Info.plist" -t 1.4.21 --description "bug fixed"

Expected Behavior

What you expected to happen? I expect the bundle to be uploaded to the code-push server.

Actual Behavior

What actually happens? I am stuck on Done copying assets. After react-release command . I get

  • info Writing bundle output to:, /var/folders/l1/lnm98dxx5kng16sy41d66b080000gn/T/code-push11955-2252-9fk90y.9i2c/CodePush/main.jsbundle
  • info Done writing bundle output
  • info Copying 28 asset files
  • info Done copying assets

and nothing after that. I check my internet connection and it is ok. I tried multiple time and waited more than half an hour on 2 instance.

  STACK TRACE AND/OR SCREENSHOTS

Reproducible Demo

  • Download https://github.com/Microsoft/react-native-code-push/archive/master.zip and unzip. From Examples folder run node create-app.js appName [email protected] [email protected] command to generate plain CodePushified React Native app. Please see description on top of create-app.js file content if needed
  • If you can't reproduce the bug on it, provide us as much info as possible about your project

Environment

  • react-native-code-push version: 5.6.0
  • react-native version: 0.59.5
  • iOS/Android/Windows version: IOS
  • Does this reproduce on a debug build or release build? N/A
  • Does this reproduce on a simulator, or only on a physical device? N/A

(The more info the faster we will be able to address it!)

nirajhi avatar Jun 05 '19 14:06 nirajhi

I restarted my computer and it is working now. Sorry for the false alarm.

nirajhi avatar Jun 05 '19 15:06 nirajhi

@nirajhi Sure, don't worry :+1: Please feel free to reopen the issue if you encounter the issue again!

yuri-kulikov avatar Jun 05 '19 15:06 yuri-kulikov

@yuri-kulikov I'm having the same issue. At first at react-native version 0.59.10. I then updated to 0.60.0 and the issue remains. CodePush version 5.6.0.

Running release with appcenter codepush release-react -a <username/app-name> -d Production --output-dir ./ios/build --sourcemap-output ./ios/build/CodePush/main.jsbundle.map

Everything seems to bundle correct but it's stuck att "info Done copying assets". Adding the --debug flag shows nothing suspicious. Restarting the computer does not fix it for me. I've tried on 2 different computers.

Any idea on what the problem may be or how to debug further?

danfri86 avatar Jul 10 '19 08:07 danfri86

@yuri-kulikov I'm having the same issue. At first at react-native version 0.59.10. I then updated to 0.60.0 and the issue remains. CodePush version 5.6.0.

Running release with appcenter codepush release-react -a <username/app-name> -d Production --output-dir ./ios/build --sourcemap-output ./ios/build/CodePush/main.jsbundle.map

Everything seems to bundle correct but it's stuck att "info Done copying assets". Adding the --debug flag shows nothing suspicious. Restarting the computer does not fix it for me. I've tried on 2 different computers.

Any idea on what the problem may be or how to debug further?

Did you manage to fix the problem?

ahmedreda97 avatar Dec 29 '19 13:12 ahmedreda97

I've been having this same issue for a while. This is what I wrote in my troubleshooting notes:

For some reason the react native cli does not exit when a command completes. This is an issue because when we are trying to read a new JS bundle for CodePush the operation hangs indefinitely. To solve this open up {REPO_ROOT}\node_modules\@react-native-community\build\cliEntry.js and modify the addCommand function to include this:

const cmd = _commander().default.command(command.name).description(command.description).action(function handleAction(...args) {
    const passedOptions = this.opts();
    const argv = Array.from(args).slice(0, -1);
    Promise.resolve().then(() => {
      (0, _assertRequiredOptions.default)(options, passedOptions);
      var result = command.func(argv, ctx, passedOptions);
      if (result && result.then) {
        result.then(() => {
          process.exit();
        });
      }
      return result;
    }).catch(handleError);
  });

The key piece of code is the call to process.exit(). Note that this fix is targeted to the bundle command. Other commands might still hang.

WARNING: The code above will prevent you from running metro js bundler for debugging so you will have to comment out process.exit().

bpshonyak avatar Apr 23 '20 13:04 bpshonyak

I'm now having this issue. Has anyone else discovered a more permanent solution or reasoning this occurs?

It blocks builds on AppCenter as they timeout and local release builds are hanging at the same location consistently. "Done copying assets"

pixelknitter avatar Mar 29 '21 19:03 pixelknitter

I've been having this same issue for a while. This is what I wrote in my troubleshooting notes:

For some reason the react native cli does not exit when a command completes. This is an issue because when we are trying to read a new JS bundle for CodePush the operation hangs indefinitely. To solve this open up {REPO_ROOT}\node_modules\@react-native-community\build\cliEntry.js and modify the addCommand function to include this:

const cmd = _commander().default.command(command.name).description(command.description).action(function handleAction(...args) {
    const passedOptions = this.opts();
    const argv = Array.from(args).slice(0, -1);
    Promise.resolve().then(() => {
      (0, _assertRequiredOptions.default)(options, passedOptions);
      var result = command.func(argv, ctx, passedOptions);
      if (result && result.then) {
        result.then(() => {
          process.exit();
        });
      }
      return result;
    }).catch(handleError);
  });

The key piece of code is the call to process.exit(). Note that this fix is targeted to the bundle command. Other commands might still hang.

WARNING: The code above will prevent you from running metro js bundler for debugging so you will have to comment out process.exit().

I dont see build folder in @react-native-community folder am i missing something

Batsirai-sudo avatar Mar 30 '21 13:03 Batsirai-sudo

Any update or help for this? I had the issue after enable Hermes on Android

msvargas avatar Aug 26 '21 15:08 msvargas

I've been having this same issue for a while. This is what I wrote in my troubleshooting notes: For some reason the react native cli does not exit when a command completes. This is an issue because when we are trying to read a new JS bundle for CodePush the operation hangs indefinitely. To solve this open up {REPO_ROOT}\node_modules\@react-native-community\build\cliEntry.js and modify the addCommand function to include this:

const cmd = _commander().default.command(command.name).description(command.description).action(function handleAction(...args) {
    const passedOptions = this.opts();
    const argv = Array.from(args).slice(0, -1);
    Promise.resolve().then(() => {
      (0, _assertRequiredOptions.default)(options, passedOptions);
      var result = command.func(argv, ctx, passedOptions);
      if (result && result.then) {
        result.then(() => {
          process.exit();
        });
      }
      return result;
    }).catch(handleError);
  });

The key piece of code is the call to process.exit(). Note that this fix is targeted to the bundle command. Other commands might still hang. WARNING: The code above will prevent you from running metro js bundler for debugging so you will have to comment out process.exit().

I dont see build folder in @react-native-community folder am i missing something

Thank you, this working for me with RN 0.65.1, I share the patch

No is the best solution but working.

@react-native-community+cli+6.0.0.patch

diff --git a/node_modules/@react-native-community/cli/build/index.js b/node_modules/@react-native-community/cli/build/index.js
index 1b5efe2..ac34ddc 100644
--- a/node_modules/@react-native-community/cli/build/index.js
+++ b/node_modules/@react-native-community/cli/build/index.js
@@ -185,6 +185,7 @@ function attachCommand(command, ...rest) {
       } else {
         await command.func(argv, rest[0], passedOptions);
       }
+      process.exit();
     } catch (error) {
       handleError(error);
     }


msvargas avatar Aug 26 '21 20:08 msvargas

Might be related to https://github.com/aeirola/react-native-svg-asset-plugin/issues/73

maxammann avatar Nov 02 '21 11:11 maxammann

For anyone coming across this but has never heard of this module, you're issue might be related to metro cache, try running the following before bundling.

npm start -- --reset-cache

SyntaxError843 avatar Jun 27 '24 06:06 SyntaxError843