커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
2-4강의 view 코드스니펫을 app.js에 넣기하려다가 이렇게 되버렸어요.
[왕초보] 나만의 수익성 앱, 앱개발 종합반 v5
2주차
북마크
장*은
댓글
7
추천
0
조회수
16
조회수
16
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.



휴대폰 연결도 안되고 어떻게 해야 할지 모르겠어요.   beom파일을 삭제하고 처음부터 다시 시작해야할까요?



  at FlowParserMixin.parseFunction (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:13255:10)

  at FlowParserMixin.parseExportDefaultExpression (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:13740:19)   

  at FlowParserMixin.parseExportDefaultExpression (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:5183:18)   

  at FlowParserMixin.parseExport (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:13667:25)

  at FlowParserMixin.parseExport (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:5312:24)

  at FlowParserMixin.parseStatementContent (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:12660:27)

  at FlowParserMixin.parseStatementLike (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:12548:17)

  at FlowParserMixin.parseStatementLike (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:5135:24)

  at FlowParserMixin.parseModuleItem (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:12525:17)

  at FlowParserMixin.parseBlockOrModuleBlockBody (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:13120:36)   

  at FlowParserMixin.parseBlockBody (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:13113:10)

  at FlowParserMixin.parseProgram (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:12439:10)

  at FlowParserMixin.parseTopLevel (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:12429:25)

  at FlowParserMixin.parseTopLevel (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:5954:28)

  at FlowParserMixin.parse (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:14250:10)

  at parse (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\parser\lib\index.js:14271:26)

  at parser (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\core\lib\parser\index.js:41:34)

  at parser.next (<anonymous>)

  at parse (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\core\lib\parse.js:25:37)

  at parse.next (<anonymous>)

  at evaluateSync (C:\Users\User\Desktop\starta-study\beom\node_modules\gensync\index.js:251:28)

  at sync (C:\Users\User\Desktop\starta-study\beom\node_modules\gensync\index.js:89:14)

  at stopHiding - secret - don't use this - v1 (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\core\lib\errors\rewrite-stack-trace.js:46:12)

  at parseSync (C:\Users\User\Desktop\starta-study\beom\node_modules\@babel\core\lib\parse.js:41:72)

  at Object.transform (C:\Users\User\Desktop\starta-study\beom\node_modules\metro-react-native-babel-transformer\src\index.js:194:11)

  at transformJSWithBabel (C:\Users\User\Desktop\starta-study\beom\node_modules\metro-transform-worker\src\index.js:399:45)

  at Object.transform (C:\Users\User\Desktop\starta-study\beom\node_modules\metro-transform-worker\src\index.js:572:18)

  at transformFile (C:\Users\User\Desktop\starta-study\beom\node_modules\metro\src\DeltaBundler\Worker.flow.js:82:36)

  at Object.transform (C:\Users\User\Desktop\starta-study\beom\node_modules\metro\src\DeltaBundler\Worker.flow.js:55:10)

  at execFunction (C:\Users\User\Desktop\starta-study\beom\node_modules\jest-worker\build\workers\processChild.js:137:17)

  at execHelper (C:\Users\User\Desktop\starta-study\beom\node_modules\jest-worker\build\workers\processChild.js:116:5)

  at execMethod (C:\Users\User\Desktop\starta-study\beom\node_modules\jest-worker\build\workers\processChild.js:120:5)

  at process.messageListener (C:\Users\User\Desktop\starta-study\beom\node_modules\jest-worker\build\workers\processChild.js:38:7)

  at process.emit (node:events:527:28)


TransformError SyntaxError: C:\Users\User\Desktop\starta-study\beom\App.js: 'import' and 'export' may only appear at the top level. (5:31)     


 3 | import { StyleSheet, Text, View, } from 'react-native';

 4 |

> 5 | export default function App() {import { StatusBar } from 'expo-status-bar';

  |                ^

 6 | import React from 'react';

tform=android&dev=true&hot=false&strict=false&minify=false:20178:35 in __callFunction

at http://192.168.219.177:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:19940:30 in <unknown>

at http://192.168.219.177:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:20130:14 in __guard

at http://192.168.219.177:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:19939:20 in callFunctionReturnFlushedQueue

info Opening C:\Users\User\Desktop\starta-study\beom\App.js with code   


Android Bundling failed 14ms

SyntaxError: C:\Users\User\Desktop\starta-study\beom\App.js: 'import' and 'export' may only appear at the top level. (5:31)


 3 | import { StyleSheet, Text, View, } from 'react-native';

 4 |

> 5 | export default function App() {import { StatusBar } from 'expo-status-bar';

  |                ^

 6 | import React from 'react';

 7 | import { StyleSheet, Text, View } from 'react-native';

 8 |


 * 복원된 기록 


PS C:\Users\User\Desktop\starta-study> cd beom

PS C:\Users\User\Desktop\starta-study\beom> expo start


s://blog.expo.dev/the-new-expo-cli-f4250d8e3421

To use the local CLI instead (recommended in SDK 46 and higher), run:   

› npx expo start


Starting project at C:\Users\User\Desktop\starta-study\beom

Starting Metro Bundler

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

█ ▄▄▄▄▄ █▀▄█▀  ▄█ ▄▄▄▄▄ █

█ █  █ █▄  ▄███ █ █  █ █

█ █▄▄▄█ █ ▀█▀█ ▀ ▀█ █▄▄▄█ █

█▄▄▄▄▄▄▄█ ▀▄█ █ ▀ █▄▄▄▄▄▄▄█

█ █ ▀▀▄ ▀█ ▀▄ ▀██▀ ▄▀▄▄▀█

█▄▀▄█▄▄▄▄█▄▄█▄▀███▄▀ ▀▀█▄▄█

██▄▀▀▄▀▄▄ █▀██▄ █▀█ ▄█ ██▀█

█▄▀█▄▄▀▄▀▀▀▄ ▄ █ ▄▄ ▀▀██▄█

█▄▄█▄██▄▄ ▀▀▀██▄ ▄▄▄ █ ▄ █

█ ▄▄▄▄▄ █▄▀█▀▄▄▄ █▄█ ▀▄ █

█ █  █ █▀██▄█ ▀▀▄ ▄▄ █▀▄██

█ █▄▄▄█ █▀▄ ██ ▄█ █▄ ▄█▄█

█▄▄▄▄▄▄▄█▄▄▄▄█▄▄█▄███▄▄█▄▄█


› Metro waiting on exp://192.168.219.177:19000

› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)  


› Press a │ open Android

› Press w │ open web


› Press r │ reload app

› Press m │ toggle menu


› Press ? │ show all commands


Logs for your project will appear below. Press Ctrl+C to exit.

Started Metro Bundler

› Stopped server

PS C:\Users\User\Desktop\starta-study\beom> expo start 


This command is being executed with the global Expo CLI. Learn more: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421

To use the local CLI instead (recommended in SDK 46 and higher), run:   

› npx expo start


Starting project at C:\Users\User\Desktop\starta-study\beom

Starting Metro Bundler

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

█ ▄▄▄▄▄ █▀▄█▀  ▄█ ▄▄▄▄▄ █

█ █  █ █▄  ▄███ █ █  █ █

█ █▄▄▄█ █ ▀█▀█ ▀ ▀█ █▄▄▄█ █

█▄▄▄▄▄▄▄█ ▀▄█ █ ▀ █▄▄▄▄▄▄▄█

█ █ ▀▀▄ ▀█ ▀▄ ▀██▀ ▄▀▄▄▀█

█▄▀▄█▄▄▄▄█▄▄█▄▀███▄▀ ▀▀█▄▄█

██▄▀▀▄▀▄▄ █▀██▄ █▀█ ▄█ ██▀█

█▄▀█▄▄▀▄▀▀▀▄ ▄ █ ▄▄ ▀▀██▄█

█▄▄█▄██▄▄ ▀▀▀██▄ ▄▄▄ █ ▄ █

█ ▄▄▄▄▄ █▄▀█▀▄▄▄ █▄█ ▀▄ █

█ █  █ █▀██▄█ ▀▀▄ ▄▄ █▀▄██

█ █▄▄▄█ █▀▄ ██ ▄█ █▄ ▄█▄█

█▄▄▄▄▄▄▄█▄▄▄▄█▄▄█▄███▄▄█▄▄█


› Metro waiting on exp://192.168.219.177:19000

› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)  


› Press a │ open Android

› Press w │ open web


› Press r │ reload app

› Press m │ toggle menu


› Press ? │ show all commands


Logs for your project will appear below. Press Ctrl+C to exit.

Started Metro Bundler




작성한 코드 및 에러 메세지

오류 발생 시, 작성한 코드 전체와 에러 메시지를 첨부해 주세요.

Tip 1) </> 아이콘을 눌러 코드박스를 만들어 보세요.

Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!



import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View, } from 'react-native';





export default function App() {
  return (
    <View style={styles.container}>
      <View style={styles.subContainerOne}></View>
      <View style={styles.subContainerTwo}></View>
    </View>
  );
}


const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
  },
  subContainerOne: {
    flex:1,
    backgroundColor:"yellow"
  },
  subContainerTwo: {
    flex:1,
    backgroundColor:"green"
  }
});
  
  return (
    <View style={styles.container}>
      <Text>우리가족 파이팅!</Text>
      <StatusBar style="auto" />
    </View>
  );
}


const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});







취소
 공유
취소
댓글 0
댓글 알림
나의얼굴