예제 속 디버깅 오류
1182
작성한 질문수 2
+ 안드로이드 애뮬레이터를 실행하고 초기 화면도 오류가 뜨면서 실행되지 않습니다.
강의 속 타이핑한 코드를 그대로 옮겨 적었는데 아래와 같은 디버깅 오류가 뜹니다.
타이핑한 코드
디버깅 콘솔
C:\Program Files\nodejs\node.exe .\App.js
Debugger attached.
(node:2188) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
Waiting for the debugger to disconnect...
c:\Users\onesm\Desktop\AppDevel\react_01\App.js:9
import React, { Component } from 'react';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:999:16)
at Module._compile (node:internal/modules/cjs/loader:1047:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
at Module.load (node:internal/modules/cjs/loader:948:32)
at Function.Module._load (node:internal/modules/cjs/loader:789:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12)
at node:internal/main/run_main_module:17:47
Process exited with code 1
(node:2188) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
null: Uncaught c:\Users\onesm\Desktop\AppDevel\react_01\App.js:9
import React, { Component } from 'react';
^^^^^^
SyntaxError: Cannot use import statement outside a module
어떤 부분을 수정헤야 하나요?
답변 1
0
onesmind97님,
안녕하세요. 지식공유자 Wintho입니다.
문의 주신 내용에 답변 드립니다.
이전 질문주신 내용과 연관이 있어보입니다.
‘Debugger attached.’ 와
‘Waiting for the debugger to disconnect…’ 라는 로그가 뜨는 걸로 봐서,
Debugger가 붙었다가 disconnect되지 않는 오류로 생각됩니다.
만일, 코드가 굉장히 단조롭고 간단했다면
Debugger가 붙지 않았을 경우는 실행이 되었을 것이고요,
Debugger가 붙은 순간에 빌드가 되었다면 실행이 안 되었을 겁니다.
Visual Studio Code를 다시 설치해보시고(1.42버전),
Debugging 하는 과정은 생략해보시기 바랍니다.
감사합니다.
강의 자료 소스코드는 없나요?
0
319
1
RN 자동완성 기능 질문
0
307
1
환경변수 및 SOURCE관련 질문
0
286
1
글로벌로 설치한다는 게 무슨 말인가요? (-g)
0
311
1
VIsual studio code 에서 react-native run-android 실행시 오류
0
841
2
리액트 네이티브에서 안드로이드 실행
0
557
1
vscode
0
403
2
안드로이드 에뮬레이터 에러...
0
962
1
웹뷰앱 만드는 자세한 방법이 궁금합니다.
0
422
0
App.js 화면 수정 시 안드로이드 emulator 오류
0
339
0
2
0
230
1
ios 구동했을 때 Welcome to React가 아니라 애플
0
470
1
1
0
202
0
진행중 막혀서 질문드립니다
0
374
0
drawer 파트
0
282
0
node.js 설치 오류
0
433
0
vs code 터미널에서의 command not found
0
1556
1
node js 10.15.1 설치가 안됩니다
0
303
0
Unable to boot device in current state: Booted 오류 발생하는경우
1
3182
0
adb 커맨드
1
525
1
Slider만 설치하면 애러가 납니다.
0
308
1
bounces 와 버튼 backgroundColor은 안드로이드에서 적용이 안되는건가요?
0
217
0
오류확인 부탁드립니다.
0
307
0
안드로이드 시뮬 작동 중 오류가 납니다.
0
234
0





