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

biome server bugs out on config, CLI works with the same. #83

Open
LaravelFreelancerNL opened this issue Aug 29, 2024 · 9 comments
Open

Comments

@LaravelFreelancerNL
Copy link

LaravelFreelancerNL commented Aug 29, 2024

I've got Biome setup with PhpStorm. It works perfectly fine from the commandline.
However the 'integrated server' fails for automated fixes with the following error on startup:

"Biome: The configuration file has errors. Biome will report only parsing errors until the configuration is fixed."

System: W11 with WSL2-ubuntu
PhpStorm: 2024.2.0.1
Biome: 1.8.3

Devdependencies:
"@biomejs/biome": "1.8.3",
"@biomejs/cli-linux-x64": "^1.8.3",
"@biomejs/cli-win32-x64": "^1.8.3",

PhpStorm Biome settings:

  • Automatic Biome configuration
  • Run biome for files: **/*.{js,mjs,mts,cjs,ts,jsx,tsx,cts,json,jsonc,vue,svelte,astro,css}
  • Run format on save.
  • Run safe fixes on save

biome.json in root of the project

{
    "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
    "formatter": {
        "indentStyle": "space",
        "indentWidth": 4,
        "lineWidth": 120
    },
    "linter": {
        "ignore": ["assets", "core", "layouts", "tests", "types"]
    },
    "vcs": {
        "defaultBranch": "master",
        "clientKind": "git",
        "enabled": true,
        "useIgnoreFile": true
    }
}

I don't see anything wrong with this config and running biome format/lint through the CLI works perfectly fine with these settings.

Am I doing something wrong or have I stumbled upon a bug?

With kind regards
Bas.

@ematipico
Copy link
Member

Can you provide a reproduction?

@LaravelFreelancerNL
Copy link
Author

What do you mean by a reproduction in this sense?
These are the exact settings that I'm using and think might be relevant, are you missing anything specific?

The jetbrains plugin fails, the CLI works with these settings (within the same project).

@ematipico
Copy link
Member

With minimal reproduction, I mean the minimal project (repository) where you can reproduce the issue consistently. I have a project very similar to yours, and I don't encounter the issue.

That's why it's important to have a brand you project, because it's possible that there are user settings that might interfere with the project

@LaravelFreelancerNL
Copy link
Author

Sure, I'll set one up over the weekend.

@Richard87
Copy link

Hi, I think i have the same issue, pretty sure it has something to do with WSL and the LSP server, I have the exact same issue in vscode

java.lang.Throwable: Failed to run Biome check with (format, safefixes, unsafefixes) for file biome.json - //wsl.localhost/Ubuntu/home/richard/projects/projectX/biome.json internalError/fs ━━━━━━━━━━

  × Cannot read file
  
  × Biome can't read the following file, maybe for permissions reasons or it doesn't exist: //wsl.localhost/Ubuntu/home/richard/projects/projectX/biome.json
  


	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.github.biomejs.intellijbiome.actions.BiomeCheckRunner.applyChanges(BiomeCheckRunner.kt:91)
	at com.github.biomejs.intellijbiome.actions.BiomeCheckRunner.access$applyChanges(BiomeCheckRunner.kt:20)
	at com.github.biomejs.intellijbiome.actions.BiomeCheckRunner$formatDocuments$1$1.run(BiomeCheckRunner.kt:58)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249)
	at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:501)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466)
	at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
	at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
	at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97)
	at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:464)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)

@LaravelFreelancerNL
Copy link
Author

I can confirm there is some kind of interference from the project itself. I haven't had time to dig deeper than a superficial check.
t.b.c.

@kbytesys
Copy link

This bug is related to the lack of support to wsl. there are other 2 bugs related to the same error.

I don't know if maintainers are planning some kind of support since we are reporting the same problem time by time :p

@Richard87
Copy link

For the record, the fix I posted in the other thread does work nicely for me:

  • winget install "Node.js"
  • possibly restart your terminal
  • Install biome on the hots (npm install -g @biomejs/biome)
  • Manually specify Biome in intellij config: C:\Users\USERNAME\AppData\Roaming\npm\biome.cmd

@kbytesys
Copy link

But this is not a fix, because you are using WSL to avoid to install software in your host (in some company laptops you can't install what you want). The real fix is to use the executable inside WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants