taiga-ui icon indicating copy to clipboard operation
taiga-ui copied to clipboard

🐞 - " not assignable to the same property in base type" error after upgrade version in @taiga-ui/core

Open rchks opened this issue 2 years ago • 7 comments

Which @taiga-ui/* package(s) are the source of the bug?

core

Please provide a link to a minimal reproduction of the bug

No response

Is this issue blocking you?

Blocking

Description

Hello, I'm facing to a issue after upgrade package version

Error: image

When I opened files, I saw this: comp abs

It's an example of the one of error reasons

Down the version. rebuilding, reinstalling are not working ways to solve the project. After all, removing all Taiga packages from project and installing at least one which is not using components with polymorpheus wasn't lead to a stable work of my app.

Could you please give any recommends and advice for fixing?

It blocks building and working with the whole application for me:(

Angular version

14.1.2

Taiga UI version

2.60.0

Which browsers have you used?

  • [X] Chrome
  • [X] Firefox
  • [ ] Safari
  • [ ] Edge

Which operating systems have you used?

  • [ ] macOS
  • [X] Windows
  • [ ] Linux
  • [ ] iOS
  • [ ] Android

rchks avatar Aug 22 '22 05:08 rchks

It looks like you have 2 versions of @tinkoff/ng-polymorpheus in your app. Could you please try removing it from package.json, if you have it there, then remove package-lock.json and node_modules and do a clean npm i. It is installed with @taiga-ui/cdk, you shouldn't have it explicitly in your package.json.

waterplea avatar Aug 22 '22 07:08 waterplea

@tinkoff/ng-polymorpheus

My trying to go by your suggested way wasn't fixed the problem, unfortunately :( The same error still shows while it's bulding What can the another reason of it?

rchks avatar Aug 22 '22 07:08 rchks

Show me please

~/my-project $ npm ls @tinkoff/ng-polymorpheus

and could you create a minimal repro on github?

splincode avatar Aug 22 '22 07:08 splincode

@tinkoff/ng-polymorpheus

image

rchks avatar Aug 22 '22 09:08 rchks

could you create a minimal repro on github?

splincode avatar Aug 24 '22 06:08 splincode

Having similar issue:

Error: node_modules/@taiga-ui/kit/components/push/push.service.d.ts:10:5 - error TS2416: Property 'open' in type 'TuiPushService' is not assignable to the same property in base type 'AbstractTuiDialogService<TuiPushOptions>'.
  Type '(content: PolymorpheusContent<TuiBaseDialogContext<string> & TuiPushOptions>, options?: Partial<TuiPushOptions> | undefined) => Observable<...>' is not assignable to type '<G = void>(content: PolymorpheusContent<TuiBaseDialogContext<G> & TuiPushOptions>, options?: Partial<TuiPushOptions> | undefined) => Observable<...>'.
    Types of parameters 'content' and 'content' are incompatible.
      Type 'PolymorpheusContent<TuiBaseDialogContext<G> & TuiPushOptions>' is not assignable to type 'PolymorpheusContent<TuiBaseDialogContext<string> & TuiPushOptions>'.
        Type 'TemplateRef<TuiBaseDialogContext<G> & TuiPushOptions>' is not assignable to type 'PolymorpheusContent<TuiBaseDialogContext<string> & TuiPushOptions>'.
          Type 'TemplateRef<TuiBaseDialogContext<G> & TuiPushOptions>' is not assignable to type 'TemplateRef<TuiBaseDialogContext<string> & TuiPushOptions>'.
            Type 'TuiBaseDialogContext<G> & TuiPushOptions' is not assignable to type 'TuiBaseDialogContext<string> & TuiPushOptions'.
              Type 'TuiBaseDialogContext<G> & TuiPushOptions' is not assignable to type 'TuiBaseDialogContext<string>'.
                Types of property 'completeWith' are incompatible.
                  Type '(value: G) => void' is not assignable to type '(value: string) => void'.
                    Types of parameters 'value' and 'value' are incompatible.
                      Type 'string' is not assignable to type 'G'.
                        'G' could be instantiated with an arbitrary type which could be unrelated to 'string'.

open(content: PolymorpheusContent<TuiBaseDialogContext<string> & TuiPushOptions>, options?: Partial<TuiPushOptions>): Observable<string>;

I'm on 2.54.0 and 14.0.6

desprit avatar Aug 28 '22 08:08 desprit

@rchks I think you can temporarily fix this by adding skipLibCheck to your tsconfig. We are going to need a reproduction to fix this though. With latest 2.x version of 3.x.

waterplea avatar Sep 19 '22 19:09 waterplea

Might be a problem with an old TypeScript version on the user side. Type definition generated with newer TS version might be incompatible with an older lib user TS version.

hakimio avatar Oct 21 '22 20:10 hakimio

I am closing this as no reproduction was provided and in my practice this issue always comes from 2 different versions of @tinkoff/ng-polymorpheus in your node_modules.

Steps to fix, if anybody stumbles upon this are:

  1. Make sure you don't have @tinkoff/ng-polymorpheus in your package.json.
  2. Update all Taiga UI packages to the latest same version.
  3. Remove node_modules and package-lock.json.
  4. Make clean npm i.

If you do that and still see this issue, please create a Github repositor to reproduce the issue and let us know.

waterplea avatar Mar 26 '23 09:03 waterplea