前提・実現したいこと
expo start を実行すると、Expoアプリ上でアプリがビルドされ、
最終的にアプリが表示される。
発生している問題・エラーメッセージ
コマンドライン上で実行(expo start / npm start)すると、
次のエラーが出力されてしまいます。
Could not get status from Metro builder. Request failed with status code 404 Connecting to Metro bundler failed.
該当のソースコード
React
1mport React from 'react'; 2import { Platform, StatusBar, StyleSheet, View } from 'react-native'; 3import { AppLoading, Asset, Font, Icon } from 'expo'; 4import AppNavigator from './navigation/AppNavigator'; 5 6export default class App extends React.Component { 7 state = { 8 isLoadingComplete: false, 9 }; 10 11 render() { 12 if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) { 13 return ( 14 <AppLoading 15 startAsync={this._loadResourcesAsync} 16 onError={this._handleLoadingError} 17 onFinish={this._handleFinishLoading} 18 /> 19 ); 20 } else { 21 return ( 22 <View style={styles.container}> 23 {Platform.OS === 'ios' && <StatusBar barStyle="default" />} 24 <AppNavigator /> 25 </View> 26 ); 27 } 28 } 29 30 _loadResourcesAsync = async () => { 31 return Promise.all([ 32 Asset.loadAsync([ 33 require('./assets/images/robot-dev.png'), 34 require('./assets/images/robot-prod.png'), 35 ]), 36 Font.loadAsync({ 37 // This is the font that we are using for our tab bar 38 ...Icon.Ionicons.font, 39 // We include SpaceMono because we use it in HomeScreen.js. Feel free 40 // to remove this if you are not using it in your app 41 'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'), 42 }), 43 ]); 44 }; 45 46 _handleLoadingError = error => { 47 // In this case, you might want to report the error to your error 48 // reporting service, for example Sentry 49 console.warn(error); 50 }; 51 52 _handleFinishLoading = () => { 53 this.setState({ isLoadingComplete: true }); 54 }; 55} 56 57const styles = StyleSheet.create({ 58 container: { 59 flex: 1, 60 backgroundColor: '#fff', 61 }, 62}); 63
試したこと
npm installを実行しました。
また、Expoのバージョンを更新しました。
ファイヤーウォールなしでも実行を行いました。
この他に、powershell上にて、次のコードを実行しました。
$env:EXPO_DEBUG = 'true'
補足情報(FW/ツールのバージョンなど)
Windows10
Visual Studio Code
スーパーセキュリティ
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。