scttcper / ngx-color

🎨 Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more
https://ngx-color.vercel.app
MIT License
436 stars 55 forks source link

Module export error in 7.3.0 #359

Closed spicemix closed 3 years ago

spicemix commented 3 years ago

Tried upgrading from 7.2.0 (working fine thank you) to 7.3.0 just now. Got this error upon compiling with Angular 12:

 Error: Module not found: Error: Package path ./circle is not exported from package [MyProjectDir]/node_modules/ngx-color (see exports field in [MyProjectDir]/node_modules/ngx-color/package.json)

Code is the standard

import { ColorCircleModule } from 'ngx-color/circle';

Rolling back to 7.2.0 fixes this instantly.

I'm using the latest yarn@1.22.17 for the project and npm@7.24.2 globally.

cipchk commented 3 years ago

@scttcper Some question, I recommend using the 8 major version number in angular 13.

scttcper commented 3 years ago

fixed in 7.3.1

spicemix commented 3 years ago

Sorry this will need to be re-opened. The ngx-color module is now found in 7.3.1 thanks, but three other modules from fesm2015 are not:

./node_modules/ngx-color/fesm2015/ngx-color-circle.mjs:7:0-178 - Error: Module not found: Error: Can't resolve 'material-colors' in '[MyProjectDir]/node_modules/ngx-color/fesm2015'

./node_modules/ngx-color/fesm2015/ngx-color-circle.mjs:8:0-44 - Error: Module not found: Error: Can't resolve '@ctrl/tinycolor' in ''[MyProjectDir]/node_modules/ngx-color/fesm2015'

./node_modules/ngx-color/fesm2015/ngx-color.mjs:7:0-44 - Error: Module not found: Error: Can't resolve '@ctrl/tinycolor' in ''[MyProjectDir]/node_modules/ngx-color/fesm2015'

The fesm2015 directory is present in the ngx-color installation, but doesn't have @ctrl or material-colors in it.

Thanks for your work on this!

spicemix commented 3 years ago

Perhaps this is now a documentation bug, as @ctrl/tinycolor and material-colors are now peer dependencies in 7.3.1 but no mention of them in the docs. Furthermore, yarn only notifies me that @ctrl/tinycolor is missing, I have to wait until compilation to know I need material-colors. Thank you!