2017-05-24 10 views
1

私は角度を学び始め、Visual Studioで簡単なプロジェクトを作成しました。唯一のhtmlファイルと別のJSファイルです。私はVisual Studio Codeを試してみることにしました。これは、フロントエンドの作業のためにコード化するより良い環境のように見えます。 しかし、私の人生のために、Chromeデバッガにページを表示させることはできません。ここでVSコードのChrome Debugger拡張機能はhtmlファイルを表示しません

は現在launch.jsonは(運にURLとWebrootのためにいくつかの変更を試してみました)されています

{ 
    "version": "0.2.0", 
    "configurations": [ 
     { 
      "type": "chrome", 
      "request": "launch", 
      "name": "Launch Chrome against localhost", 
      "url": "http://localhost:9222/index.html", 
      "webRoot": "${workspaceRoot}" 
     }, 
     { 
      "type": "chrome", 
      "request": "attach", 
      "name": "Attach to Chrome", 
      "port": 9222, 
      "webRoot": "${workspaceRoot}" 
     } 
    ] 
} 

私はクロームが起動して接続するために取得することができますが、私は完全に空白のページを取得します。私はデバッグしたり、これを引き起こしている可能性があります何を見てどのように実際にお試しいただくか、するものを、この時点では見当もつかない

[ { 
    "description": "", 
    "id": "2c0aed08-5bf3-4186-9ad6-9af1bc9e500c", 
    "title": "localhost:9222/index.html", 
    "type": "page", 
    "url": "http://localhost:9222/json" 
}, { 
    "description": "", 
    "devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/ccfbea86-ec75-434e-9ae0-749eba4cbf2b", 
    "id": "ccfbea86-ec75-434e-9ae0-749eba4cbf2b", 
    "title": "Chrome Media Router", 
    "type": "background_page", 
    "url": "chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/_generated_background_page.html", 
    "webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/ccfbea86-ec75-434e-9ae0-749eba4cbf2b" 
} ] 

:私は、私にこれを提供します/ JSONをlocalhostに行くことができます。どんな助けや方向性も高く評価されます。

答えて

1

これが正解であるかどうかはわかりません。しかしlaunch.jsonを変更してファイル自体をインクルードしました。ブラウザウィンドウでページャをデバッグして表示できるようになりました。また、diagnosticLoggingをオンにすると、マッピングのいくつかをどのように行っていたかを見ることができました。

{ 
    "name": "Launch Chrome", 
    "type": "chrome", 
    "request": "launch", 
    "url": "http://localhost:9222/", 
    "webRoot": "${workspaceRoot}\\", 
    "file": "${workspaceRoot}/index.html", 
    "diagnosticLogging": true 
} 
関連する問題