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

1.18.3 fails to activate with older VS Code versions #11680

Closed
xizhan0513 opened this issue Nov 14, 2023 · 14 comments
Closed

1.18.3 fails to activate with older VS Code versions #11680

xizhan0513 opened this issue Nov 14, 2023 · 14 comments
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release
Milestone

Comments

@xizhan0513
Copy link

Environment

  • OS and Version: win10 x64 version 10.0.19045.2728

  • VS Code Version:
    Version: 1.79.2 (user setup)
    Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
    Date: 2023-06-14T08:57:04.379Z
    Electron: 22.5.7
    Chromium: 108.0.5359.215
    Node.js: 16.17.1
    V8: 10.8.168.25-electron.0
    OS: Windows_NT x64 10.0.19045

  • C/C++ Extension Version: 1.18.3

  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:
when C/C++ extension Version is 1.18.3, go to definition function cannot be used
When I roll back the version to 1.17.5, go to definition function available

Configuration and Logs

1

Other Extensions

No response

Additional context

No response

@blueWALL-E
Copy link

I had the same problem as you, and after switching to a lower version, the situation improved.

@utkuucak
Copy link

utkuucak commented Nov 14, 2023

Having a similar problem. Contextual options such as Go to definition or Go to declaration when right clicking a function name does not appear.

Outline tabs says No symbols found in document <filename>.c.

Downgrading to v1.17.5 fixes the issue.

@tmedicci
Copy link

Same here. Extension output log:

2023-11-14 09:54:46.998 [error] Activating extension ms-vscode.cpptools failed due to an error:
2023-11-14 09:54:46.998 [error] ReferenceError: fetch is not defined
	at Object.preReleaseCheck (/home/tiago/.vscode/extensions/ms-vscode.cpptools-1.18.3-linux-x64/dist/src/main.js:53947:26)
	at activate (/home/tiago/.vscode/extensions/ms-vscode.cpptools-1.18.3-linux-x64/dist/src/main.js:93776:26)
	at async v.n (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:6644)
	at async v.m (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:6607)
	at async v.l (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:6064)

@sean-mcmanus sean-mcmanus self-assigned this Nov 14, 2023
@sean-mcmanus sean-mcmanus added bug Language Service regression A bug that didn't exist in a previous release labels Nov 14, 2023
@sean-mcmanus sean-mcmanus pinned this issue Nov 14, 2023
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Nov 14, 2023

It looks like @tmedicci is seeing the extension fail to activate -- is everyone else seeing that too? i.e. does all extension functionality not work, or it just a problem with symbols (go to def)? Assuming the extension activates, does doing a C/C++: Reset IntelliSense Database command fix the issue?

@sean-mcmanus sean-mcmanus added this to the 1.18.4 milestone Nov 14, 2023
@tmedicci
Copy link

It looks like @tmedicci is seeing the extension fail to activate -- is everyone else seeing that too? i.e. does all extension functionality not work, or it just a problem with symbols (go to def)? Assuming the extension activates, does doing a C/C++: Reset IntelliSense Database command fix the issue?

It's exactly that. No functionality is available because the extension fails to initialize. No command works (including Reset IntelliSense Database ). Downgrading to the last version prior the newest one "solves" it.

@sean-mcmanus sean-mcmanus added more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one). labels Nov 14, 2023
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Nov 14, 2023

Does anyone have any idea what is "special" about your setup, i.e. why our team isn't able to repro this?

Our team is testing with the latest VS Code 1.84.2 or the latest Insiders -- it looks like one person has 1.79.2 -- is everyone else using an older VS Code version. FYI, older VS Code versions don't have security issues fixes, so it's recommended to upgrade, e.g. microsoft/vscode#192906.

i.e. if that's the issue, then the potential "fix" would be to ship 1.18.4 with a higher VS Code dependency, so if you can't upgrade your VS Code version, then using 1.17.5 is the recommended workaround.

@dpkrxl
Copy link

dpkrxl commented Nov 14, 2023

Got error: [Uncaught ReferenceError: node is not defined] for c++ extension so extension was not getting activated at all. Updated VSCode to latest 1.84.2 and all is fine now!

@tmedicci
Copy link

Does anyone have any idea what is "special" about your setup, i.e. why our team isn't able to repro this?

Our team is testing with the latest VS Code 1.84.2 or the latest Insiders -- it looks like one person has 1.79.2 -- is everyone else using an older VS Code version. FYI, older VS Code versions don't have security issues fixes, so it's recommended to upgrade, e.g. microsoft/vscode#192906.

i.e. if that's the issue, then the potential "fix" would be to ship 1.18.4 with a higher VS Code dependency, so if you can't upgrade your VS Code version, then using 1.17.5 is the recommended workaround.

I'm using Manjaro and I was building VS Code. Updating it to the latest version fixed it.

@aharonamir
Copy link

Got the same error: "ReferenceError: fetch is not defined", updated to the latest vscode, reinstalled extensions and now it works fine.

@sean-mcmanus sean-mcmanus removed more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one). labels Nov 14, 2023
@sean-mcmanus sean-mcmanus changed the title After updating the C/C++ extension to Version 1.18.3: November 13, 2023, go to definition function cannot be used 1.18.3 fails to activate with older VS Code versions Nov 14, 2023
@musteresel
Copy link

musteresel commented Nov 14, 2023

I have that issue, too:

Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.5.6
2023-11-14 21:35:08.336 [error] Activating extension ms-vscode.cpptools failed due to an error:
2023-11-14 21:35:08.336 [error] ReferenceError: fetch is not defined
	at Object.preReleaseCheck (/home/musteresel/.vscode/extensions/ms-vscode.cpptools-1.18.3-linux-x64/dist/src/main.js:53947:26)
	at activate (/home/musteresel/.vscode/extensions/ms-vscode.cpptools-1.18.3-linux-x64/dist/src/main.js:93776:26)
	at async p.n (/nix/store/jxjlqqrld7dilz5nhdflqy3cskyrs9pj-vscode-1.81.1/lib/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:6206)
	at async p.m (/nix/store/jxjlqqrld7dilz5nhdflqy3cskyrs9pj-vscode-1.81.1/lib/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:6169)
	at async p.l (/nix/store/jxjlqqrld7dilz5nhdflqy3cskyrs9pj-vscode-1.81.1/lib/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:5626)

Result is no working intellisense which is quite annoying.
Downgrading the extension to v1.17.5 (next newest release after 1.18.3) "fixes" this.

@musteresel
Copy link

It's this fetch:

const response = await fetch('https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery', {

@musteresel
Copy link

musteresel commented Nov 14, 2023

And the function with that fetch has been introduced in that commit:
8fbc56a

And the issue is that VS Code (at least the version I'm using) is using a node.js version without a globally defined fetch, as described here: https://stackoverflow.com/a/48433898

This means this issue will come up for everyone using VS Code before version 1.82 (from August 2023), because then electron and with it node.js was update: https://code.visualstudio.com/updates/v1_82#_engineering

@sean-mcmanus
Copy link
Collaborator

@musteresel Thanks for the info -- that helped a lot. We have a pending fix at #11683

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Nov 14, 2023
@sean-mcmanus
Copy link
Collaborator

Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.18.4 .

@sean-mcmanus sean-mcmanus unpinned this issue Nov 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

8 participants