Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
Visual Studio Code: Open current HTML file in browser (launch.json)

I am using Visual Studio Code and would like to debug the currently open HTML file in a web browser, Microsoft Edge in this case. My project folder is the webroot of a locally installed web server (http://localhost). I have installed the VS Code extension "Microsoft Edge Tools for VS Code" and created a launch.json configuration with the following content:

{
"configurations": [
    {
        "name": "Launch Microsoft Edge and open the Edge DevTools",
        "request": "launch",
        "type": "vscode-edge-devtools.debug",
        "webRoot": "${workspaceFolder}",
        "url": "http://localhost/${relativeFile}"
    }
  ]
}

However, when i launch this debugger, Microsoft Edge opens with the URL http://localhost/$%7BrelativeFile%7D, so it seems that the variable ${relativeFile} is not resolved.

How can I fix this and achieve my goal?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The relativeFile will refer to the current opened file relative to workspaceFolder. You need to specify the path of the folder opened in VS Code, the webroot

{

"configurations": [
    {
        "name": "Launch Microsoft Edge and open the Edge DevTools",
        "request": "launch",
        "type": "vscode-edge-devtools.debug",
        "webRoot": "${workspaceFolder}"      // "${workspaceFolder}/src"
        "url": "http://localhost/${relativeFile}"
    }
  ]
}

Ref:- https://code.visualstudio.com/docs/editor/variables-reference

Update per comments:-

%7B and %7D are ASCII codes for { and }. While you're in launch.json, check the bottom right of VScode and see what the encoding is? It should be UTF-8

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda