Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot build my VSCode extension project in VSCode after update to 1.76 #175833

Closed
imSoly opened this issue Mar 2, 2023 · 25 comments
Closed

I cannot build my VSCode extension project in VSCode after update to 1.76 #175833

imSoly opened this issue Mar 2, 2023 · 25 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@imSoly
Copy link

imSoly commented Mar 2, 2023

  • VS Code Version: 1.76.0
  • OS Version: macOS Monterey 12.6

I'm making a vscode extension.
When I use version 1.75.0, In the project root path, I could build and run [Extension Development Host] by pressing F5.
However, after updating to 1.76, I cannot build my VSCode extension project in VSCode. No alert, No OUTPUT, No DEBUG CONOLE.

So now, I'm using 1.75.0, It works very well.
I think version 1.76 has some bugs.

Steps to Reproduce:

  1. Update VSCode to version 1.76
  2. Press F5
@imSoly imSoly changed the title I cannot build my VSCode extension project in VSCode after update to 1.76.0 I cannot build my VSCode extension project in VSCode after update to 1.76 Mar 2, 2023
@roblourens
Copy link
Member

Can you give some more details? What happens? What does your build task do? Can you share the project?

Any error messages in devtools (Help > Toggle Developer Tools)?

@roblourens roblourens added the info-needed Issue requires more information from poster label Mar 2, 2023
@StephaneAdeso
Copy link

Have the same issue

@ArturoDent
Copy link

Can you give some more details? What happens? What does your build task do? Can you share the project?

Any error messages in devtools (Help > Toggle Developer Tools)?

@StephaneAdeso Can you provide the above additional information?

@StephaneAdeso
Copy link

Today i decided to start an extension project. I installed the dependencies following the https://code.visualstudio.com/api/get-started/your-first-extension guide.
After creating the extension, i pressed F5 and nothing happened. So i suppose there is a bug by default on the yo-code extensions because i didnt modified yet any files.

I also have to say that i tried an old theme project ( 8 month old) and i was able to launch it with F5 without any problem.

I also tried the launch.json that you shared in Stackoverflow https://stackoverflow.com/questions/75619530/f5-not-working-in-vscode-extension-development/75619753#75619753 and it works perfectly.

So i am pretty sure there is something wrong in the launch.json that is generated by default.

You can see my files and version in the stackoverflow post.

@StephaneAdeso
Copy link

StephaneAdeso commented Mar 2, 2023

No output error messages on the devtools when i press F5

@StephaneAdeso
Copy link

there you have the files that was autogenerated and dont work. i have changed anything since Yo-code created the project.

launch.json

// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run Extension",
            "type": "extensionHost",
            "request": "launch",
            "args": [
                "--extensionDevelopmentPath=${workspaceFolder}"
            ],
            "outFiles": [
                "${workspaceFolder}/out/**/*.js"
            ],
            "preLaunchTask": "${defaultBuildTask}"
        },
        {
            "name": "Extension Tests",
            "type": "extensionHost",
            "request": "launch",
            "args": [
                "--extensionDevelopmentPath=${workspaceFolder}",
                "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
            ],
            "outFiles": [
                "${workspaceFolder}/out/test/**/*.js"
            ],
            "preLaunchTask": "${defaultBuildTask}"
        }
    ]
}

tasks.json

// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "watch",
            "problemMatcher": "$tsc-watch",
            "isBackground": true,
            "presentation": {
                "reveal": "never"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

package.json

{
  "name": "xxxxx",
  "displayName": "xxxxx",
  "description": "xxxxx",
  "version": "0.0.1",
  "engines": {
    "vscode": "^1.76.0"
  },
  "categories": [
    "Other"
  ],
  "activationEvents": [],
  "main": "./out/extension.js",
  "contributes": {
    "commands": [
      {
        "command": "xxxxx",
        "title": "Hello World"
      }
    ]
  },
  "scripts": {
    "vscode:prepublish": "npm run compile",
    "compile": "tsc -p ./",
    "watch": "tsc -watch -p ./",
    "pretest": "npm run compile && npm run lint",
    "lint": "eslint src --ext ts",
    "test": "node ./out/test/runTest.js"
  },
  "devDependencies": {
    "@types/vscode": "^1.76.0",
    "@types/glob": "^8.1.0",
    "@types/mocha": "^10.0.1",
    "@types/node": "16.x",
    "@typescript-eslint/eslint-plugin": "^5.53.0",
    "@typescript-eslint/parser": "^5.53.0",
    "eslint": "^8.34.0",
    "glob": "^8.1.0",
    "mocha": "^10.2.0",
    "typescript": "^4.9.5",
    "@vscode/test-electron": "^2.2.3"
  }
}

@StephaneAdeso
Copy link

StephaneAdeso commented Mar 2, 2023

Is there a detailed documentation of how to configure a launch.json ? where you can consult all the available parameters and how they work.

this is not enaugh detailed

@GabeDeBacker
Copy link
Contributor

I'm also hitting this and can confirm that nothing "dubious" is showing in the console of the development tools. As a matter of fact, there is almost nothing there. (Which is odd, because it's normally full of output from the extension host, extensions, etc.)

Additional information is that it appears (at least for our extension) that the extension activates (when it's not supposed to) and then seems to just "stop" being executed.

Here's "all" of the console output from the extension host developer tools console

[Extension Host] STOPPED on first line for debugging on port 53603
J @ localProcessExtensionHost.ts:366
languagesAssociations.ts:73 Overwriting extension <<.mk>> to now point to mime <<text/x-Windows.NMake>>
(anonymous) @ languagesAssociations.ts:73
languagesAssociations.ts:77 Overwriting filename <> to now point to mime <<text/x-Windows.NMake>>
(anonymous) @ languagesAssociations.ts:77
localProcessExtensionHost.ts:298 Extension Host
localProcessExtensionHost.ts:299 Debugger attached.
console.ts:137 [Extension Host] activating extension (at console. (c:\Users\gabrield\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:96:138784))
console.ts:137 [Extension Host] starting language server (at console. (c:\Users\gabrield\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:96:138784))

@pgwatinfor
Copy link

I can confirm the issue in v1.76 that nothing happens when pressing the F5 key.
I have to use the menu option Run>Start Debugging, a bit tedious.

@roblourens
Copy link
Member

This is probably due to a misbehaving extension, please run the "Start Extension Bisect" command to figure out which one it might be

@mjbvz
Copy link
Collaborator

mjbvz commented Mar 3, 2023

Possibly same issue as #175202. F5 build tasks seem to activate too many extensions

@roblourens
Copy link
Member

Yeah @mjbvz there is a fix out in #176006, if you are seeing it please bisect to figure out which extension is breaking it, I think it would just be nice to know which common extensions are impacted

@connor4312
Copy link
Member

Same as #175976. I have a little more info there.

@StephaneAdeso
Copy link

The start extension bisec is just awsome. i just did it and i found that its because of java extension. i posted the bug here microsoft/vscode-java-dependency#721

@StephaneAdeso
Copy link

StephaneAdeso commented Mar 3, 2023

i tried to use F5 after disabling the java plugin, but F5 still not working.

@roblourens
Copy link
Member

Maybe there's a second one then.

@StephaneAdeso
Copy link

StephaneAdeso commented Mar 3, 2023

i disabled the java extension, but it didn't work. so i executed bisec again and it detected the Material icon extension. so i disabled it and it didn't work. Still having the F5 issue. i think there is something more behind all this.

@StephaneAdeso
Copy link

StephaneAdeso commented Mar 5, 2023

i commented the preLaunchTask in my launch.json and now it works perfectly. Which seems strange to me, because JSON doesn't allow comments. But it has worked and now it boots with F5 without problems.
I had it like this :

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Run Extension",
			"type": "extensionHost",
			"request": "launch",
			"args": [
				"--extensionDevelopmentPath=${workspaceFolder}"
			],
			"outFiles": [
				"${workspaceFolder}/out/**/*.js"
			],
			"preLaunchTask": "${defaultBuildTask}"
		},
		{
			"name": "Extension Tests",
			"type": "extensionHost",
			"request": "launch",
			"args": [
				"--extensionDevelopmentPath=${workspaceFolder}",
				"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
			],
			"outFiles": [
				"${workspaceFolder}/out/test/**/*.js"
			],
			"preLaunchTask": "${defaultBuildTask}"
		}
	]
}

and now I have it like this:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Run Extension",
      "type": "extensionHost",
      "request": "launch",
      "args": ["--extensionDevelopmentPath=${workspaceFolder}"],
      "outFiles": ["${workspaceFolder}/out/**/*.js"]
      /* "preLaunchTask": "${defaultBuildTask}" */
    },
    {
      "name": "Extension Tests",
      "type": "extensionHost",
      "request": "launch",
      "args": [
        "--extensionDevelopmentPath=${workspaceFolder}",
        "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
      ],
      "outFiles": ["${workspaceFolder}/out/test/**/*.js"],
      "preLaunchTask": "${defaultBuildTask}"
    }
  ]
}

@StephaneAdeso
Copy link

I can confirm that after 1.76.1 update, F5 is still broke.

@roblourens
Copy link
Member

It sounds like there might be an issue with your build task then.

@StephaneAdeso
Copy link

It sounds like there might be an issue with your build task then.

As I mentioned above, the project is made from scratch with the yo-code plugin. The task is the one that comes by default.

@meganrogge
Copy link
Contributor

Pretty sure this is fixed in insider's - can you pls try to repro there and let me know?

@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
@hippietrail
Copy link

I have the same problem on macOS Ventura 13.1 and VS Code 1.77.3

It seems to be partly/mostly related to other extensions.

Sometimes I get nothing happening at all. Sometimes I get a bunch of errors from totally unrelated extensions.

I believe I have mostly on the default or most popular extension for each of about a dozen programming languages. I use vscode for programming but I'm quite clueless on how to get things working for run/debug configurations.

@github-actions github-actions bot locked and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

12 participants