-
Notifications
You must be signed in to change notification settings - Fork 41
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
Property binding produces 'no-incompatible-type-binding' error for 'default' types #154
Comments
I am now seeing a similar error on a second property I've added to the pt-material custom elements mentioned in the original issue.
In this second instance, I received the following error:
In this second instance, the type of the property is a union with a generic utility type that is equivalent to VS Code 1.57.0 |
@patorpey I know this issue is quite old, but I wonder if you're still experiencing this, or if you maybe found a fix or workaround? I'm still seeing the same issue in v1.4.0. The maddening thing is that it's really inconsistent (getting the error message in some places while not seeing it in others for the exact same type) and I haven't been able to reproduce the problem in a minimal project (so maybe it has something to do with the complexity/size of the project?). We rely on |
@MaKleSoft Yes, I'm still experiencing this with version 1.4.0. After some refactoring and continued development (for purposes other than to satisfy lit-plugin), this is now only appearing in one file in one project, which includes the examples in my original issues above. I've not found a workaround. I just know that this file always is in an error state and have come to ignore it. I've been hoping that this will someday be resolved by the release and adoption of the Lit team's own analyzer. It's been a while since they announced that and I imagine it will be a while longer before it gets integrated it into an equivalent Lit linter plugin. VS Code 1.70.3 |
I think I experienced the same bug:
From what I see, the types are equal (literally!). Could you please fix this? As a workaround, I'm writing a |
also fix lit linter as eslint errors runem/lit-analyzer#154 the lit analyzer currently reports a false positive (no-incompatible-type-binding) for generic types that are actually equal
also fix lit linter as eslint errors runem/lit-analyzer#154 the lit analyzer currently reports a false positive (no-incompatible-type-binding) for generic types that are actually equal
Any solution to this? I'm seeing something quite similar. |
When binding a particular class to a property on a subclass of LitElement, lit-plugin within VS Code produces an error on the binding of a class instance to that property in a template that a type of 'default' is not assignable to 'default'.
Material
is a base class used as a data store.pt-material is a subclass of LitElement that renders a view of data in Material instances and declares the property as such:
Another subclass of LitElement binds instances of the Material class to pt-material elements.
The property name "material" in
.material=${m}
is underlined with the following error:I have tried to satisfy the lit-plugin rule through more explicit Typescript typing and by adding
type: Object
to the@property
decorator argument, but the error persists in this location. Elsewhere in my application I use similar bindings without the error, but haven't been able to identify what makes this occurrence unique, given the the error. I am uncertain what "default" indicates here. Typescript reports the type ofm
to be Material. The binding does function correctly at runtime, despite the error.VS Code 1.52.1
Node.js: 12.14.1
Typescript: 4.1.2
lit-plugin: 1.2.1
The text was updated successfully, but these errors were encountered: