biomejs/biome-vscode

๐Ÿ› Error during extension activation

Closed this issue ยท 8 comments

Extension version

2.1.2

Biome version

1.5.3

Operating system

  • Windows
  • macOS
  • Linux

Description

The extension hasn't been working for me since a long time. I used to use Biome (nightly) to workaround it, but after using pre-releases instead, I cannot workaround it now, and I cannot install the nightly extension anymore.

Screenshot 2024-02-25 at 3 38 47โ€ฏPM Screenshot 2024-02-25 at 3 39 03โ€ฏPM

I tried to rm -rf all of these files and install again but it's still the same:

~/Library/Caches/dev.biomejs.biome/
~/Library/Application Support/Code/CachedExtensionVSIXs/biomejs.biome-2.1.2
~/Library/Application Support/Code/CachedExtensionVSIXs/biomejs.biome-2024.2.180911
~/Library/Application Support/Code/User/globalStorage/biomejs.biome-nightly/
~/Library/Application Support/Code/User/globalStorage/github.vscode-pull-request-github/mentionableUsers/biomejs/"mentionableUsers/biomejs/
~/Library/Application Support/Code/User/workspaceStorage/a7f8779e138249a08dd303e379921e5e/biomejs.biome-nightly/"biome-nightly/"biome-nightly/
~/Library/Application Support/Code/User/workspaceStorage/2494cbf7408af6f0400cb09200025efa/biomejs.biome-nightly/"biome-nightly/
~/Library/Application Support/Code/User/workspaceStorage/617ba0f85fec7d3086f01c3300008aef/biomejs.biome-nightly/
~/Library/Application Support/Code/User/workspaceStorage/0b14f3415f97a11c2e48f788969955f4/biomejs.biome-nightly/"biome-nightly/
~/Library/Application Support/Code/User/workspaceStorage/cc166bb585e1c6a68ded8ce260fbe199/biomejs.biome-nightly/"biome-nightly/"biome-nightly/
~/Library/Application Support/Code/User/workspaceStorage/6ffd687be8fbefe0983f7b6226aa07c9/biomejs.biome-nightly/"biome-nightly/
~/Library/Application Support/Code/User/workspaceStorage/50e3b92dd3b6ca6f1a10b4f1ff951a56/biomejs.biome-nightly/

Steps to reproduce

  1. Install the extension

Expected behavior

To work

Does this issue occur when using the CLI directly?

No

Logs

N/A

Hey,

Thanks for opening this issue.

What is the version of VS Code ?

Also, if there is a stack trace with the error on the screenshot, could you paste it?

Thanks for the quick reply! (Also my apology for forgetting to update the title)

VS Code:

Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:20:33.924Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin x64 23.2.0

The error in the picture is expanded, it does not show any stack trace I do not know why. This is the only occurrence of biome in the logs.

When I click on the source:
Screenshot 2024-02-25 at 8 02 37โ€ฏPM

Thanks, I was able to reproduce the issue.

[error] Activating extension biomejs.biome failed due to an error:
2024-02-25 13:48:31.275 [error] ReferenceError: ReadableStream is not defined
	at node_modules/.pnpm/undici@6.4.0/node_modules/undici/lib/fetch/response.js (/Users/nicolas/Downloads/test/code-portable-data/extensions/biomejs.biome-2.1.2/out/main.js:30886:7)
	at __require (/Users/nicolas/Downloads/test/code-portable-data/extensions/biomejs.biome-2.1.2/out/main.js:8:50)
	at node_modules/.pnpm/undici@6.4.0/node_modules/undici/lib/fetch/index.js (/Users/nicolas/Downloads/test/code-portable-data/extensions/biomejs.biome-2.1.2/out/main.js:31655:9)
	at __require (/Users/nicolas/Downloads/test/code-portable-data/extensions/biomejs.biome-2.1.2/out/main.js:8:50)
	at node_modules/.pnpm/undici@6.4.0/node_modules/undici/index.js (/Users/nicolas/Downloads/test/code-portable-data/extensions/biomejs.biome-2.1.2/out/main.js:36042:21)
	at __require (/Users/nicolas/Downloads/test/code-portable-data/extensions/biomejs.biome-2.1.2/out/main.js:8:50)
	at Object.<anonymous> (/Users/nicolas/Downloads/test/code-portable-data/extensions/biomejs.biome-2.1.2/out/main.js:37025:29)
	at u._compile (/Users/nicolas/Downloads/test/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (/Users/nicolas/Downloads/test/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:130:28084)
	at f._load (/Users/nicolas/Downloads/test/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:130:25418)
	at C._load (/Users/nicolas/Downloads/test/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at require (node:internal/modules/cjs/helpers:102:18)
	at Function.i [as __$__nodeRequire] (/Users/nicolas/Downloads/test/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:98)
	at r.rb (/Users/nicolas/Downloads/test/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:130:26597)
	at async Promise.all (index 0)

Looks like an issue related to our use of undici (fetch implementation). I'll investigate.

Looks like I've been a bit aggressive with the dependencies updates.

Bumping undici from v5 to v6 introduces the ReadableStream is undefined issue.

Updating vscode-languageclient from 8 to 9 also creates a requirement on VS Code 1.82.

I'll revert these changes and ship a nightly so that you can try.

I've published pre-release v2024.2.251322. Would you mind downloading it and confirming if it solves your issue?

Wow what a speed! It works, thank you!

Screenshot 2024-02-25 at 9 42 46โ€ฏPM

Awesome, thanks for confirming!