Bundles stuck on 99% if previous build attempt contained syntax error - Or does not build at all
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
Confirmed. This is making development extremely slow. Occurs after the new expo cli
@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?
@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```
@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 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.
I'm having the same issue. The development process is severely worsened. At times it makes Expo unusable.
@Brandons42 if possible could you include the output of running expo diagnostics?
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
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
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
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
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.
+1
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
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 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.
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
Also seeing this across two Macs even after upgrading. Any solution?
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
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