Skip to content

Wrong VSCode launch.json after au new -u -s http2,dotnet-core,typescript,htmlmin-min,vscode,scaffold-navigation  #1135

@alexdresko

Description

@alexdresko

I'm submitting a bug report

  • Library Version:
    Local aurelia-cli v1.0.2

Please tell us about your environment:
Windows 10

PS C:\code\test\au-css\aurelia-app> node -v
v12.3.1
PS C:\code\test\au-css\aurelia-app> npm -v
6.9.0

  • Browser:
    Chrome

  • Language:
    TypeScript

  • Loader/bundler:
    Webpack

Current behavior:

  1. au new aurelia-app -u -s http2,dotnet-core,typescript,htmlmin-min,vscode,scaffold-navigation

The following launch.json is created:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Chrome",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceRoot}/src",
      "userDataDir": "${workspaceRoot}/.chrome",
      "sourceMapPathOverrides": {
        "webpack:///./src/*": "${webRoot}/*"
      }
    }
  ]
}

Ideally, since I created this as an ASP.NET Core application, I should be able to open the new application in VSCode and press F5 to launch and debug the application. However, this launch.json file isn't correct for an ASP.NET Core application.

To get around the problem, I perform the following steps:

  1. delete launch.json

  2. shut down VSCode.

  3. start VSCode

  4. VSCode prompts again to create the file:
    image

  5. VSCode produces the correct launch.json:

    {
       // Use IntelliSense to find out which attributes exist for C# debugging
       // Use hover for the description of the existing attributes
       // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
       "version": "0.2.0",
       "configurations": [
            {
                "name": ".NET Core Launch (web)",
                "type": "coreclr",
                "request": "launch",
                "preLaunchTask": "build",
                // If you have changed target frameworks, make sure to update the program path.
                "program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/project.dll",
                "args": [],
                "cwd": "${workspaceFolder}",
                "stopAtEntry": false,
                // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
                "serverReadyAction": {
                    "action": "openExternally",
                    "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"                
                },
                "env": {
                    "ASPNETCORE_ENVIRONMENT": "Development"
                },
                "sourceFileMap": {
                    "/Views": "${workspaceFolder}/Views"
                }
            },
            {
                "name": ".NET Core Attach",
                "type": "coreclr",
                "request": "attach",
                "processId": "${command:pickProcess}"
            }
        ]
    }
    
  • What is the expected behavior?
    VSCode should probably create the correct JSON file out of the box.

  • What is the motivation / use case for changing the behavior?
    It's not a very good developer experience for someone who is just getting started with Aurelia. It's not necessarily Aurelia's fault, but something is causing the wrong file to be created.

I suppose the reason for the existing launch.json file could be to support an au run scenario, but that doesn't feel like the typical development workflow for someone using VSCode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions