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

🐛 Parser is no longer progressing #3284

Closed
ugistelmokaitis opened this issue Jun 25, 2024 · 9 comments · Fixed by #3433
Closed

🐛 Parser is no longer progressing #3284

ugistelmokaitis opened this issue Jun 25, 2024 · 9 comments · Fixed by #3433
Labels
A-Parser Area: parser L-CSS Language: CSS

Comments

@ugistelmokaitis
Copy link

Environment information

> npx @biomejs/biome check --write .

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: /Users/runner/work/biome/biome/crates/biome_parser/src/lib.rs:535:9
Thread Name: biome::worker_5
Message: The parser is no longer progressing. Stuck at ')' R_PAREN:236..237

Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: /Users/runner/work/biome/biome/crates/biome_parser/src/lib.rs:535:9
Thread Name: biome::worker_6
Message: The parser is no longer progressing. Stuck at ')' R_PAREN:4196..4197

./src/styles/minHeight/minHeight.module.css internalError/panic  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ processing panicked: The parser is no longer progressing. Stuck at ')' R_PAREN:242..243
  
  ⚠ This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.


### What happened?

1. I run  ```npx @biomejs/biome check --write .``` and then encounter error 
2. I've tried formatting ```pnpm biome format --write . ```  and this command runs  successfully.
3. When I try linting ```pnpm biome lint --write .``` I get same error as explained above in 'Environment information' field

### Expected result

Safe fixes should be applied to all files using a linting command based on documentation based on documentation https://biomejs.dev/guides/getting-started/. 

However, at the moment, I have only encountered an error in one of my project so far. This is an error that I have never had before.

### Code of Conduct

- [X] I agree to follow Biome's Code of Conduct
@denbezrukov
Copy link
Contributor

denbezrukov commented Jun 25, 2024

I'm wondering if you have an example to reproduce the issue.
You can use our playground: https://biomejs.dev/playground/?indentStyle=space&quoteStyle=single&jsxQuoteStyle=single&lintRules=all

@ugistelmokaitis
Copy link
Author

It's a private repository with over 400 commits. So not too sure what's the best way to reproduce an example of it. Any suggestions as I don't want to open source it?

@minht11
Copy link
Contributor

minht11 commented Jun 25, 2024

Can you isolate that one file? I imagine that Biome parses files independently, so you shouldn't need the whole project. The method that works for me: delete files until error is gone, thats how I narrow reproductions down.

@Sec-ant
Copy link
Member

Sec-ant commented Jun 25, 2024

It's a private repository with over 400 commits. So not too sure what's the best way to reproduce an example of it. Any suggestions as I don't want to open source it?

From the error message, the error is triggered by this file: ./src/styles/minHeight/minHeight.module.css, somewhere around the 242nd character. Should that help you narrow down the file and the place?

@ugistelmokaitis
Copy link
Author

I've isolated and seems like problem is css files for some reason.

here is an example of entire file - minHeight.module.css


.literal {
    min-height: var(--umrel-min-height-xs, auto);
}

.min-height {
    min-height: calc(var(--umrel-min-height-xs) * var(--umrel-height-100));
}

@each $breakpoint in xs, sm, md, lg, xl {
    @media (--umrel-breakpoints-$breakpoint) {
        .literal--$breakpoint {
            min-height: var(--umrel-min-height-$breakpoint);
        }

        .min-height--$breakpoint {
            min-height: calc(var(--umrel-min-height-$breakpoint) * var(--umrel-height-100));
        }
    }
}

this shouldn't have any issues with linting but for some reason it does

@ematipico ematipico added A-Parser Area: parser L-CSS Language: CSS S-Bug-confirmed Status: report has been confirmed as a valid bug labels Jun 25, 2024
@ugistelmokaitis
Copy link
Author

ugistelmokaitis commented Jun 25, 2024

so the issues seems to be with 'postcss-each' https://www.npmjs.com/package/postcss-each. Every-time in css modules I used @each I get a linting error

@Sec-ant
Copy link
Member

Sec-ant commented Jun 25, 2024

The minimal reproduction: https://biomejs.dev/playground/?files.main.css=QABtAGUAZABpAGEAIAAoAC0ALQB1AG0AcgBlAGwALQBiAHIAZQBhAGsAcABvAGkAbgB0AHMALQAkAGIAcgBlAGEAawBwAG8AaQBuAHQAKQAgAHsAfQA%3D

Is the dollar sign SASS syntax? We only support standard CSS and CSS modules at the moment.

But yeah the parser shouldn't panic.

@ugistelmokaitis
Copy link
Author

@Sec-ant yes that's right. But with postcss-each plugin you can iterate through values which is very handy and it's using dollar sign

@ematipico
Copy link
Member

ematipico commented Jun 25, 2024

Ah, we don't support SASS/LESS syntax, and we don't support esoteric plugins like postcss does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Parser Area: parser L-CSS Language: CSS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants