2

일부 오류로 인해 localhost를 열 수없고 VS 코드에서 TypeScript 파일을 디버깅 할 수 없습니다. 나는 표적을 to "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--remote-debugging-port=9222"크롬 속성에 설정했습니다. [debugger-for-chrome] Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222으로 오류가 발생했습니다. chrome.exe 프로세스를 모두 종료 한 후 오류에 대한 다음 이미지를 참조하십시오. 누군가이 문제를 해결하도록 도와 줄 수 있습니까? 미리 감사드립니다.TypeScript로 디버깅 할 수 없습니다 - VS 코드

Failed to Load Error

.vscode/launch.json :

{ 
    "version": "0.2.0", 
    "configurations": [ 
     { 
      "name": "Launch index.html with sourcemaps", 
      "type": "chrome", 
      "request": "launch", 
      "file": "${workspaceRoot}/index.html", 
      "sourceMaps": true, 
      "webRoot": "${workspaceRoot}" 
     }, 
     { 
      "name": "Launch localhost with sourcemaps", 
      "type": "chrome", 
      "request": "launch", 
      "url": "http://localhost:3000", 
      "sourceMaps": true, 
      "webRoot": "${workspaceRoot}" 
     }, 
     { 
      "name": "Attach with sourcemaps", 
      "type": "chrome", 
      "request": "attach", 
      "port": 9222, 
      "sourceMaps": true, 
      "webRoot": "${workspaceRoot}" 
     } 
    ] 
} 

tsconfig.json :

{ 
    "compilerOptions": { 
     "target": "es5", 
     "sourceMap": true 
    } 
} 

응용 프로그램/app.ts :

var x = 1; 
console.log(x); //made debugger here in VS Code 

index.html을 : 직접 질문이지만 대답

<!doctype html> 
<html> 
<body> 
    <h3>TypeScript Debugger</h3> 

    <script src="app/app.js"></script> 
</body> 
</html> 
+0

당신이 알고, 당신이, 텍스트를 그 텍스트 파일을 게시 할 수 원격 디버깅 플래그 –

+0

다시 시작하려고 다음 작업 관리자에서 모든'chrome.exe' 프로세스를 죽이고 시도하고 : 이 스크린 샷을 참조하십시오? 누군가 자신의 상황을 재현하려면 해당 코드를 모두 다시 입력해야합니다. –

+0

@Gideon 모든 chrome.exe 프로세스를 죽이려고했습니다. 이제 방금 편집 한이 게시물에서 참조 할 수있는 리소스 : net :: ERR_CONNECTION_REFUSED (http : // localhost : 3000 /) "오류가 발생했습니다. –

답변

2

하지 아마도 여전히 유용 : 당신은 당신이 중단 점을 포함, 크롬에서 직접 타이프를 디버깅 할 수 있다는 것을 알고 계셨습니까? 플러그인을 설치할 필요조차 없습니다.

enter image description here

+1

이것은 시원합니다. 하지만 어떻게 코드에 대 한'nativescript js' 프로젝트 (안드로이드 및 ios)를 디버깅 할 수 있습니까? –

+0

nativescript 에뮬레이터 문제와 관련하여 내 [post] (http://stackoverflow.com/questions/38131709/tns-run-android-emulator-not-working-nativescript)를 확인하고 해결책을 줄 수 있습니까? –

관련 문제