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

Property '"colorPicker"' is incompatible with index signature , Type '{ alias: "colorPicker"; required: false; }' is not assignable to type 'string'. #341

Open
mohitv789 opened this issue Oct 15, 2023 · 5 comments

Comments

@mohitv789
Copy link

First Error --> ngx-color-picker/lib/color-picker.directive.d.ts:108:103 : Property '"colorPicker"' is incompatible with index signature , Type '{ alias: "colorPicker"; required: false; }' is not assignable to type 'string'.

Subsequent Errors -->
a) Error: node_modules/ngx-color-picker/lib/helpers.d.ts:22:76 : Property '"rg"' is incompatible with index signature.Type '{ alias: "rg"; required: false; }' is not assignable to type 'string'.
b) node_modules/ngx-color-picker/lib/helpers.d.ts:44:80 : Property '"rgX"' is incompatible with index signature. Type '{ alias: "rgX"; required: false; }' is not assignable to type 'string'.

Now whenever I try to use properties of color-picker in HTML elements ( tried with input / span / button ) everytime I am getting error as : Can't bind to 'cpDisableInput' since it isn't a known property of 'input'

My Project Setup :
Backend is Djangorestframework served through nginx proxy
Frontend is Angular (15) in which I am using ngx-color-picker in a component . I am making a shared module as below , importing and exporting in component module and importing shared module in app module.

Share.Module.Ts :

import { CommonModule } from '@angular/common';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { ColorPickerModule } from 'ngx-color-picker';



@NgModule({
  imports: [
    CommonModule,
    ColorPickerModule
  ],
  exports: [
    CommonModule,
    ColorPickerModule
  ],
  declarations: [],
  providers: []
})
export class SharedModule {

  static forRoot(): ModuleWithProviders<SharedModule> {
    return {
      ngModule: SharedModule
    };
  }
}

Am I doing it correctly?

@mohitv789
Copy link
Author

Any suggestions , anyone ?

@chaudhry13
Copy link

I am also getting the same error. any help here?

@juancarlos-eco
Copy link

juancarlos-eco commented Nov 13, 2023

Has someone found a solution or workaround?

@rahulknagori
Copy link

Downgrade to v14.0.0. Everything must work smoothly.
Run this command - npm install [email protected]

@loicgreffier
Copy link

Faced the same issue trying to run v16.0.0 with Angular v15. Downgrading to ngx-color-picker to v14.0.0 solved the issue.

The issue does not occur when running ngx-color-picker v16.0.0 and Angular v16.

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

No branches or pull requests

5 participants