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

🐛 Panic internal error: entered unreachable code in lint/correctness/use_exhaustive_dependencies.rs #4568

Open
1 task done
qarmin opened this issue Nov 18, 2024 · 3 comments · May be fixed by #4578
Open
1 task done
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@qarmin
Copy link

qarmin commented Nov 18, 2024

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

What happened?

timeout -v 150 biome lint TEST___FILE.ts

crashes with

Source Location: crates/biome_js_analyze/src/lint/correctness/use_exhaustive_dependencies.rs:610:13
Thread Name: biome::worker_1
Message: internal error: entered unreachable code

File - compressed.zip

Expected result

No crash

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@qarmin qarmin added the S-Needs triage Status: this issue needs to be triaged label Nov 18, 2024
@arendjr
Copy link
Contributor

arendjr commented Nov 18, 2024

Thanks so much for the detailed reports! It may take us a bit to get back to all of them, but rest assured they're on our radar!

@dyc3 dyc3 self-assigned this Nov 18, 2024
@dyc3 dyc3 added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Nov 18, 2024
@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Nov 18, 2024
@dyc3
Copy link
Contributor

dyc3 commented Nov 18, 2024

In this case, Biome is failing to detect that Point is imported, so this may be a bug in the semantic model. Specifically this line is returning false:

@dyc3
Copy link
Contributor

dyc3 commented Nov 18, 2024

In the sample, this line is getting parsed as JS_BOGUS_STATEMENT, and not JS_IMPORT:

import type {Point} from '.geomet';

The reason is that this becomes bogus is because this is typescript syntax in a js file. Removing type fixes the crash, as well as renaming it to a .ts file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants