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

updating to latest version fails to compile and error as dependency missing #171

Open
sheikalthaf opened this issue Sep 21, 2020 · 24 comments

Comments

@sheikalthaf
Copy link

Describe the bug
after upating to latest version I'm getting this error

ERROR in The target entry-point "material-community-components/color-picker" has missing dependencies:
 - @thebespokepixel/es-tinycolor
 - tinycolor2

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@aceleghin
Copy link

Same error here, old import seems not exists anymore (in the doc I still see the v7 with this import:
import {MccColorPickerModule} from 'material-community-components' )
With the new import I have the same missing dependencies
Already tried to delete node modules but nothing changed.
I have angular 10.1.2

@motabass
Copy link
Contributor

motabass commented Sep 21, 2020

Hi. There is in fact a new peer dependency not packaged with the lib @thebespokepixel/es-tinycolor used for all the color calculations in the color-picker. This is missing in the docs and README.md and also the docs and demo are still on 7.0.0. The breaking change about secondary imports also should have been statet in the changelog. Sorry for that.

@tiaguinho can you update the demo? I already took care of the missing docs about new import method and peer dependency: #173

@jordandh
Copy link

Same error here, old import seems not exists anymore (in the doc I still see the v7 with this import:
import {MccColorPickerModule} from 'material-community-components' )
With the new import I have the same missing dependencies
Already tried to delete node modules but nothing changed.
I have angular 10.1.2

It looks like you import from subfolders now:
import { MccColorPickerModule } from 'material-community-components/color-picker';

@motabass
Copy link
Contributor

Thats correct

@eholman
Copy link

eholman commented Sep 29, 2020

@tiaguinho There is a good need for updated demo's/documentation.

Another error:

ERROR in src/app/shared/components/input/input.component.html:20:23 - error TS2322: Type '""' is not assignable to type '"openOnFocus" | "default"'.

20       <input matInput mccColorPickerOrigin #trigger="mccColorPickerOrigin" [formControlName]="controlName"  />

which should become either
<input matInput mccColorPickerOrigin="openOnFocus" #trigger="mccColorPickerOrigin" [formControlName]="controlName" /> or <input matInput mccColorPickerOrigin="default" #trigger="mccColorPickerOrigin" [formControlName]="controlName" />

I like the feature openOnFocus though 👍

@motabass
Copy link
Contributor

motabass commented Sep 30, 2020

@eholman the error appears only when having "strictTemplates" = true in your angularCompilerOptions.

I'll try to change the types to work with strict template type checks.

EDIT: i maybe found a solution already:
https://angular.io/guide/template-typecheck#troubleshooting-template-errors
https://angular.io/guide/template-typecheck#input-setter-coercion

@motabass
Copy link
Contributor

5a1a341 should fix all error showing up due to strictTemplates checks

@motabass
Copy link
Contributor

motabass commented Oct 6, 2020

All changes are now documented and https://github.com/tiaguinho/material-community-components/releases/tag/v9.0.1 is released so this can be closed i think

@motabass
Copy link
Contributor

motabass commented Oct 7, 2020

The demo is now up to date:
https://tiaguinho.github.io/material-community-components/

@eholman
Copy link

eholman commented Oct 9, 2020

5a1a341 should fix all error showing up due to strictTemplates checks

Good move and great job!

@aceleghin
Copy link

I still see tinycolor2 missing dependencies

@motabass
Copy link
Contributor

motabass commented Oct 15, 2020

@lippomano @sheikalthaf It seems as if an import from @types/tinycolor2 in the lib is causing this. Could you try if the error disapears if you add that to your devDependencies. I also changed the import to an type-only import import type { Instance } from 'tinycolor' in #181. I hope it helps.

@tiaguinho
Copy link
Owner

Thanks @motabass
@lippomano can you check with v9.0.2?

@motabass
Copy link
Contributor

@tiaguinho 9.0.2 has _theming.scss missing!!

@tiaguinho
Copy link
Owner

tiaguinho commented Oct 19, 2020

@motabass I just publish a new version fixing this.
Thanks

@lippomano can you check version v9.0.3?

@VladMstv
Copy link

VladMstv commented Oct 20, 2020

@tiaguinho Installed v 9.0.3 and installed additionally @thebespokepixel/es-tinycolor v 2.1.1
Keeps giving me this:

ERROR in node_modules/material-community-components/color-picker/color-picker.types.d.ts:2:13 - error TS1005: '=' expected.

2 import type { Instance } from 'tinycolor2';
              ~
node_modules/material-community-components/color-picker/color-picker.types.d.ts:2:31 - error TS1005: ';' expected.

2 import type { Instance } from 'tinycolor2';

@motabass
Copy link
Contributor

motabass commented Oct 20, 2020

@VladMstv which TypeScript version are you using? Seems to have no support for Type-only imports.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html

@VladMstv
Copy link

VladMstv commented Oct 20, 2020

@VladMstv which TypeScript version are you using? Seems to have no support for Type-only imports.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html

@motabass
Yeah, seems like that, 3.7.5. I'll try to upgrade it.

@devlfm
Copy link

devlfm commented Oct 29, 2020

Hi, I'm also having this problem.. 9.0.3 didn't fix it.
I need the fix for the drag outside box on color picker, if there's another release with that fix I'm ok with that.

Angular CLI: 9.1.12
Node: 12.19.0
OS: linux x64

Angular: 9.1.12
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.12
@angular-devkit/build-angular     0.901.12
@angular-devkit/build-optimizer   0.901.12
@angular-devkit/build-webpack     0.901.12
@angular-devkit/core              9.1.12
@angular-devkit/schematics        9.1.12
@angular/cdk                      9.2.4
@angular/flex-layout              9.0.0-beta.31
@angular/material                 9.2.4
@ngtools/webpack                  9.1.12
@schematics/angular               9.1.12
@schematics/update                0.901.12
rxjs                              6.6.3
typescript                        3.8.3
webpack                           4.42.0

@motabass
Copy link
Contributor

motabass commented Nov 1, 2020

Being on typescript > 3.8 and adding @types/tinycolor2 to your devDependencies should fix it for now.

@belivo
Copy link

belivo commented Nov 16, 2020

On a clean install I get this compilation error:

ERROR in node_modules/material-community-components/color-picker/color-picker.types.d.ts:41:29 - error TS2709: Cannot use namespace 'Instance' as a type.

41 export declare type Color = Instance;

@tiaguinho
Copy link
Owner

@belivo which Angular and MCC version are you using?

@belivo
Copy link

belivo commented Nov 19, 2020

@tiaguinho
"@angular/cli": "10.1.7"
"typescript": "4.0.3"
I think it was version 9.0.3

@muehan
Copy link

muehan commented Aug 11, 2021

no solution jet?

An error occurred during the build:
Error: The target entry-point "material-community-components/color-picker" has missing dependencies:
 - @thebespokepixel/es-tinycolor

    at TargetedEntryPointFinder.findEntryPoints (...\node_modules\@angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)

dependency:

Angular 12.2
material-community-components 11.0.0

dev-dependency:

@types/tinycolor2 1.4.3

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

10 participants