expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

Bundles stuck on 99% if previous build attempt contained syntax error - Or does not build at all

Open Nantris opened this issue 8 years ago • 51 comments

Description

The bundler tries using old versions of the code after changes are made, showing syntax errors which were resolved. It does try to build, so it knows the file was updated, but it keeps the old, broken code for its build attempt.

To reproduce: Write some code with a syntax error and then fix it. I can press R and Shift+R all you want, but 99% is as far as it goes without restarting expo entirely.

This seems to be the same issue reported here: https://github.com/react-community/create-react-native-app/issues/560

Expected Behavior

Build completes when input code is valid.

Observed Behavior

Changes to files are noticed and rebuild is attempted, but the code continues to fail to build, showing syntax errors which were corrected already. Pressing Shift+R gets the bundler to try to rebuild, but it gets stuck at 99% if the previous input code was invalid.

Environment

Expo CLI 2.4.0 environment info: System: OS: Windows 7 Binaries: Yarn: 1.10.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD

Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/slapbox-0218467b-abe6-470d-ac38-a9a8ff0a2baa.tar.gz

Also specify:

  • Pixel 2, Android 9

Nantris avatar Nov 18 '18 22:11 Nantris

Confirmed. This is making development extremely slow. Occurs after the new expo cli

thomashagstrom avatar Nov 23 '18 14:11 thomashagstrom

@thomashagstrom can you post the output of running expo diagnostics and the device/emulator you're testing with so we can increase the odds of getting this resolved?

Nantris avatar Nov 23 '18 19:11 Nantris

@Slapbox Sure. Here's one after changing networks.

08:58
Error running `xcrun simctl openurl booted exp://127.0.0.1:19000`: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=60):
The operation couldn’t be completed. Operation timed out
Operation timed out
ERROR
08:58
Error installing or running app. Error: Process exited with non-zero code: 60```

thomashagstrom avatar Nov 26 '18 08:11 thomashagstrom

@Slapbox here's a common example, where syntax was wrong and Expo is unable to recover even with Command + R reloading.

iOS simulator states

DownloadingJavaScript bundle 100,00%

[14:26:32] SyntaxError: /Users/.../build/about/AboutScreen.js: Unexpected token (9:54)
[14:26:32]    7 |     render() {
[14:26:32]    8 |         return (React.createElement(View, { style: { padding: 20 } },
[14:26:32] >  9 |             React.createElement(ScrollView, { style:  >
[14:26:32]      |                                                       ^
[14:26:32]   10 |                     (React.createElement(CrossLabel, null, "L\u00E5t some text")
[14:26:32]   11 |                         ,
[14:26:32]   12 |                             (React.createElement(CrossLabel, null, "some other text f\u00E5.")
[14:26:32] Failed building JavaScript bundle.

Doing "run on simulator" does nothing:

Opening exp://127.0.0.1:19000 in iOS simulator No effect

Restaring app on simulator does nothing. Restarting iOS Simulator is required.

thomashagstrom avatar Nov 27 '18 13:11 thomashagstrom

@thomashagstrom I agree it's definitely an issue. If possible you should include the output of running expo diagnostics.

My one report is a data point, but two is a pattern that greatly increases the odds this gets fixed, even if the odds remain low with just the two of us reporting it.

Nantris avatar Nov 29 '18 03:11 Nantris

I'm having the same issue. The development process is severely worsened. At times it makes Expo unusable.

Brandons42 avatar Dec 12 '18 08:12 Brandons42

@Brandons42 if possible could you include the output of running expo diagnostics?

Nantris avatar Dec 12 '18 16:12 Nantris

Just started getting this error out of nowhere, was working last night:

Edit: FYI, this was fixed after a system restart

expo diagnostics There is a new version of expo-cli available (2.6.13). You are currently using expo-cli 2.6.0 Run npm install -g expo-cli to get the latest version

Expo CLI 2.6.0 environment info: System: OS: macOS 10.14 Shell: 5.3 - /bin/zsh Binaries: Node: 8.11.3 - /usr/local/bin/node Yarn: 1.7.0 - /usr/local/bin/yarn npm: 6.1.0 - /usr/local/bin/npm Watchman: 4.7.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.1 AI-173.4819257 Xcode: 10.0/10L213o - /usr/bin/xcodebuild npmPackages: expo: ^30.0.0 => 30.0.1 react: 16.3.1 => 16.3.1 react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4 react-navigation: ^2.13.0 => 2.18.0 npmGlobalPackages: expo-cli: 2.6.0

nicotroia avatar Dec 14 '18 17:12 nicotroia

same issue here

  Expo CLI 2.6.14 environment info:
    System:
      OS: macOS 10.14.1
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.12.0 - /usr/local/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 6.5.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^30.0.1 => 30.0.2 
      react: 16.3.1 => 16.3.1 
      react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4 
      react-navigation: ^2.17.0 => 2.18.0 
    npmGlobalPackages:
      expo-cli: 2.6.14

YKSing avatar Jan 02 '19 03:01 YKSing

Having a similar problem with expo stuck after syntax error:

[08:13:09] SyntaxError: (redacted)/App.js: Unexpected token, expected "{" (5:0)
[08:13:09]
[08:13:09]   3 |
[08:13:09]   4 | import
[08:13:09] > 5 | import stateStore from 'state-store';
[08:13:09]     | ^
[08:13:09]   6 |
[08:13:09]   7 | export default class App extends React.Component {
[08:13:09]   8 |   render() {
Building JavaScript bundle [                                                                                                    ] 0%

Diagnostics:

  Expo CLI 2.6.14 environment info:
    System:
      OS: macOS 10.14.2
      Shell: 5.6.2 - /usr/local/bin/zsh
    Binaries:
      Node: 11.4.0 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^31.0.2 => 31.0.6
      react: 16.5.0 => 16.5.0
      react-native: https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz => 0.57.1
    npmGlobalPackages:
      expo-cli: 2.6.14

a-chernykh avatar Jan 03 '19 16:01 a-chernykh

Same issue! Please fix!!! So frustrating, only way to fix is to completely close the expo app on simulator and then reopen it. Only happens sometimes tho...very peculiar issue

cooperbrown9 avatar Jan 10 '19 01:01 cooperbrown9

Agreed. I tried to start a new project with the create react native CLI (which uses expo) and tried working with it for ~6 hours. I found many issues trying to add third-party repo's that worked on react-native-init, but don't with expo. And because of this bug where the javascript bundler sometimes won't rebuild after a syntax error, I had to restart the entire app ~30 times over the course of the 6 hours. Unfortunately the developer experience is unusable right now. Hope it can be fixed soon.

joshterrill avatar Jan 13 '19 22:01 joshterrill

+1

diegolaciar avatar Jan 30 '19 18:01 diegolaciar

guys, any idea about this problem? I try to create a project and I got the same error.

Expo CLI 2.7.1 environment info: System: OS: macOS High Sierra 10.13.6 Shell: 3.2.57 - /bin/bash Binaries: Node: 10.15.0 - /usr/local/bin/node npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: expo: ^27.1.1 => 27.1.1 react: ^16.3.1 => 16.3.1 react-native: ^0.55.4 => 0.55.4 react-navigation: ^3.0.9 => 3.1.2 npmGlobalPackages: expo-cli: 2.7.1

maasantos10 avatar Feb 01 '19 23:02 maasantos10

After experiencing this issue a few times, it seems as though this issue only occurs if there's an error in your application when you start up the development server(if there's an error when you run "expo/yarn/npm start").

Brandons42 avatar Feb 02 '19 05:02 Brandons42

@Brandons42 in my experience it occurs any time there's an error in your code which isn't corrected before the build process fails.

So if you make a typo, save, quickly correct it, and save again you can usually avoid it. If you make a typo, save, and the build hits the error before you correct it, I have to end the script 99.9% of the time and run expo start again.

Nantris avatar Feb 02 '19 19:02 Nantris

Also seeing this, however it gets stuck on 0% often after a syntax error:

  Expo CLI 2.10.0 environment info:
    System:
      OS: macOS 10.14.3
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 11.9.0 - /usr/local/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.5.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^32.0.0 => 32.0.5 
      react: 16.5.0 => 16.5.0 
      react-native: https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz => 0.57.1 
      react-navigation: ^2.16.0 => 2.18.3 
    npmGlobalPackages:
      expo-cli: 2.10.0

melv-n avatar Feb 11 '19 21:02 melv-n

Also seeing this across two Macs even after upgrading. Any solution?

nickparkin avatar Feb 25 '19 11:02 nickparkin

Same.

➜ expo diagnostics
There is a new version of expo-cli available (2.11.6).
You are currently using expo-cli 2.10.1
Run `npm install -g expo-cli` to get the latest version

  Expo CLI 2.10.1 environment info:
    System:
      OS: macOS 10.14.3
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.4 - ~/.nvm/versions/node/v8.11.4/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 5.10.0 - ~/.nvm/versions/node/v8.11.4/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.0 AI-171.4408382
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      @storybook/react-native: ^3.3.10 => 3.4.11 
      expo: ^31.0.4 => 31.0.4 
      react: 16.5.0 => 16.5.0 
      react-native: https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz => 0.57.1 
      react-navigation: ^3.0.5 => 3.0.5 
    npmGlobalPackages:
      expo-cli: 2.10.1

brettdh avatar Mar 04 '19 13:03 brettdh

Same for me happens when I don't specify the correct require path and retry again

  Expo CLI 2.11.8 environment info:
    System:
      OS: macOS 10.14
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.12.0 - /usr/local/bin/node
      Yarn: yarn install v0.19.1
      npm: 5.5.1 - /usr/local/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^32.0.0 => 32.0.6
      react: 16.5.0 => 16.5.0
      react-native: https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz => 0.57.1
      react-navigation: ^3.4.1 => 3.4.1
    npmGlobalPackages:
      expo-cli: 2.11.8

elizamaria avatar Mar 17 '19 14:03 elizamaria