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

The prop value with an expression type of TSSatisfiesExpression could not be resolved. #131

Open
antho1jp opened this issue Jul 6, 2023 · 5 comments

Comments

@antho1jp
Copy link

antho1jp commented Jul 6, 2023

Receiving the error:

The prop value with an expression type of TSSatisfiesExpression could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately.

During local builds of NextJS application.

@antho1jp antho1jp changed the title The prop value with an expression type of TSSatisfiesExpression could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately. The prop value with an expression type of TSSatisfiesExpression could not be resolved. Jul 6, 2023
@ljharb
Copy link
Member

ljharb commented Jul 6, 2023

Thanks! I believe that's pretty new in TS. Can you provide some code that uses satisfies?

@michaeldebetaz
Copy link

michaeldebetaz commented Jul 16, 2023

Same problem for me for a couple of months, sorry I didn't take the time to report it earlier. Here is an example of a code where eslint complain:

type FormData = {
  name: string;
}

function Input() {
  return <input type="text" name={"name" satsifies keyof FormData} />
}

It seems that it gives the error when a prop mix the expected type with a satisfies in it.

@MattyBalaam
Copy link

MattyBalaam commented Mar 12, 2024

I’m getting the same issue here, we also have some inputs we want to make sure are correct: name={'fieldName' satisfies keyof Fields}

We make extensive use of satisfies and the only places we see this issue are the places where we use this string satisifes keyof Type pattern

@mifi
Copy link

mifi commented Mar 20, 2024

Did anyone find a workaround? does TS have any other keyword that can be used instead of satisfies (inline in JSX)? I know of as but it's unsafe and cannot be used here

@ljharb
Copy link
Member

ljharb commented Mar 20, 2024

The fix for this in this package isn’t hard, but getting the tests to run on a new enough TS version so it can be tested is, unfortunately.

@mifi there’s no way to have the safety of that TS feature without using the feature, i believe.

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

No branches or pull requests

5 participants