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

Cadence plugin failed to be activated in the latest VSCode #626

Closed
btspoony opened this issue Jun 6, 2024 · 3 comments · Fixed by #627
Closed

Cadence plugin failed to be activated in the latest VSCode #626

btspoony opened this issue Jun 6, 2024 · 3 comments · Fixed by #627
Assignees
Labels
bug Something isn't working

Comments

@btspoony
Copy link

btspoony commented Jun 6, 2024

Instructions

Problem

Failed to be activated
Here is the error log in extension log:

2024-06-06 18:55:07.751 [error] Activating extension onflow.cadence failed due to an error:
2024-06-06 18:55:07.751 [error] TypeError: Cannot set property crypto of #<Object> which has only a getter
	at Object.<anonymous> (/Users/bibi/.vscode/extensions/onflow.cadence-2.3.3/out/extension/src/main.js:88:22729)
	at o._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
	at Module.load (node:internal/modules/cjs/loader:1098:32)
	at Module._load (node:internal/modules/cjs/loader:945:12)
	at c._load (node:electron/js2c/node_init:2:13672)
	at E._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:176:5901)
	at n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:173:30787)
	at t._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:138:33074)
	at Module.require (node:internal/modules/cjs/loader:1122:19)
	at require (node:internal/modules/helpers:130:18)
	at Function.i [as __$__nodeRequire] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:98)
	at u.xb (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:173:31966)
	at async Promise.all (index 0)

I have rolled back multiple versions, but none of them works.
I suspect it is related to the recent changes in VSCode.

Steps to Reproduce

Open VSCode.

Acceptance Criteria

Let it work.

Context

MacOS: Sonoma 14.5
flow-cli: v1.19.1
VSCode: 1.90.0 (Universal) commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573

Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0
@btspoony btspoony added the bug Something isn't working label Jun 6, 2024
@btspoony
Copy link
Author

btspoony commented Jun 6, 2024

I think it is caused by:
https://github.com/onflow/vscode-cadence/blob/master/extension/src/crypto-polyfill.ts
Is this crypto-polyfill still necessary?
It seems that there is no usage of this method through a global search.

@jribbink
Copy link
Contributor

jribbink commented Jun 6, 2024

I think it is caused by: https://github.com/onflow/vscode-cadence/blob/master/extension/src/crypto-polyfill.ts Is this crypto-polyfill still necessary? It seems that there is no usage of this method through a global search.

It's used by the WASM language server unfortuntately (would be nice if we could pass it in instead of having to polyfill globally, but sadly this is what it uses). Will take a look.

@turbolent
Copy link
Member

Maybe the polyfill should be conditional, so it's only used if the injected function doesn't exist?

@jribbink jribbink mentioned this issue Jun 6, 2024
6 tasks
@github-project-automation github-project-automation bot moved this to ✅ Done in 🌊 Flow 4D Jun 6, 2024
@jribbink jribbink self-assigned this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants