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

Errors displaying an error line and part of code #560

Open
prc5 opened this issue Apr 28, 2024 · 0 comments
Open

Errors displaying an error line and part of code #560

prc5 opened this issue Apr 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@prc5
Copy link

prc5 commented Apr 28, 2024

Describe the feature request

After using StyleX for some time, I think it would be great to have some more accurate error messages displaying details like error line and optionally part of the invalid code if that's possible?

Let's take this example:

// some-file.stylex.ts 

// dynamic/incorrect value for stylex
let displayValue = "flex";

const styles = stylex.create({
  base: {
    display: displayValue
  }
})

Current formatting:

Errror: Users/...path.../some-file.stylex.ts Only static values are allowed inside of a stylex.create() call.

New formatting:

Errror: Only static values are allowed inside of a stylex.create() call. Evaluating display: displayValue at Users/...path.../some-file.stylex.ts:43

With the new formatting:

  • Important details are listed first - "What's wrong?" and "Which part?"
  • Longer details which are harder to read are listed at the end showing path and broken line in the code

In my opinion it would make the debugging experience a bit easier and intuitive. 🙏🏻

The current appearance of errors makes me a bit concerned about the "lack of control" over the state of the codebase when I am not receiving enough details. 😅

@prc5 prc5 added the enhancement New feature or request label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant