New error: Type 'string' is not assignable to type 'string & ...'
See original GitHub issuepackages/linear-progress/src/mwc-linear-progress-base.ts:109:9 - error TS2322: Type 'string' is not assignable to type 'string & ((property: string) => string) & ((property: string) => string) & ((index: number) => string) & ((property: string) => string) & ((property: string, value: string | null, priority?: string | undefined) => void)'.
Type 'string' is not assignable to type '(property: string) => string'.
109 this.bufferElement
~~~~~~~~~~~~~~~~~~
110 .style[property as Exclude<keyof CSSStyleDeclaration, 'length'|'parentRule'>] =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/linear-progress/src/mwc-linear-progress-base.ts:119:9 - error TS2322: Type 'string' is not assignable to type 'string & ((property: string) => string) & ((property: string) => string) & ((index: number) => string) & ((property: string) => string) & ((property: string, value: string | null, priority?: string | undefined) => void)'.
Type 'string' is not assignable to type '(property: string) => string'.
119 this.primaryBar
~~~~~~~~~~~~~~~
120 .style[property as Exclude<keyof CSSStyleDeclaration, 'length'|'parentRule'>] =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To repro:
npm ci
npm run build:styling
tsc -b -f
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Typescript Type 'string' is not assignable to type - Stack Overflow
I mean something like this let myFruit:Fruit = "Apple" let something:string = myFruit as string It is giving me error: Conversion of type...
Read more >Type 'string' is not assignable to type in TypeScript | bobbyhadz
The "Type 'string' is not assignable to type" TypeScript error occurs when we try to assign a value of type string to something...
Read more >Type 'string' is not assignable to type 'string[]' : r/typescript
Hi - I'm trying to create a component where one of the properties of the component is an array of strings. I've set...
Read more >Type 'string' is not assignable to type 'never'.ts(2322)
id: i + 1, // here it gives error Type 'number' is not assignable to type 'never'.ts(2322) ... In above code error I...
Read more >type 'string' is not assignable to type 'number'. - You.com
1. The way you defined initialValue 's type means that it has to be an array, where its first value is either a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Im having a similar issue as @amcasey. This code was working as expected TS < 3.9.x. I am still seeing this error in the 3.9.2 release.
Well, when I added
| symbol
the error went away, seems that the correct type isstring | symbol
and not juststring
orsymbol
as it fits my needs 😃