pIvan / ngx-color-picker

Pure Angular color picker library.
MIT License
96 stars 16 forks source link

error when compiling with Angular 11 #41

Closed zak905 closed 2 years ago

zak905 commented 2 years ago

I followed the instructions in README to add the library to my project, after relaunching I get the following error:

Error: ./node_modules/@iplab/ngx-color-picker/fesm2015/iplab-ngx-color-picker.mjs 2073:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)m
    at HarmonyImportSpecifierDependency._getErrors (/home/zakaria/Desktop/myWork/imager200/imager200-platform/src/main/resources/static/imager200-front/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:88:6)
    at HarmonyImportSpecifierDependency.getErrors (/home/zakaria/Desktop/myWork/imager200/imager200-platform/src/main/resources/static/imager200-front/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
    at Compilation.reportDependencyErrorsAndWarnings (/home/zakaria/Desktop/myWork/imager200/imager200-platform/src/main/resources/static/imager200-front/node_modules/webpack/lib/Compilation.js:1463:22)
    at /home/zakaria/Desktop/myWork/imager200/imager200-platform/src/main/resources/static/imager200-front/node_modules/webpack/lib/Compilation.js:1258:10
    at _next0 (eval at create (/home/zakaria/Desktop/myWork/imager200/imager200-platform/src/main/resources/static/imager200-front/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:32:1)
    at eval (eval at create (/home/zakaria/Desktop/myWork/imager200/imager200-platform/src/main/resources/static/imager200-front/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:45:1)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

based on some intitial research, it seems like something is up with Webpack

pIvan commented 2 years ago

Hi @zak905 can you use 2.1.1 version, I need to find out what is going on with compilation

pIvan commented 2 years ago

My fault, the version compiled with angular 13 is not compatible with angular 11. Versions <= 2.1.1 are compatible with angular <= 12