leo6104 / ngx-slick-carousel

Angular 17+ wrapper for slick plugin
106 stars 43 forks source link

Angular 10 Upgrade - Can't import the named exports from non EcmaScript module (only default export is available) #108

Closed hp1493 closed 1 year ago

hp1493 commented 1 year ago

We are performing Angular upgrade on a legacy application , post angular 10 upgrade and install , we are facing several issue of same sort when trying to start the application. ` ERROR in ./node_modules/ngx-slick-carousel/fesm2015/ngx-slick-carousel.mjs 483:12-24 Can't import the named export 'CommonModule' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/ngx-slick-carousel/fesm2015/ngx-slick-carousel.mjs 493:13-25 Can't import the named export 'CommonModule' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/ngx-slick-carousel/fesm2015/ngx-slick-carousel.mjs 503:16-28 Can't import the named export 'CommonModule' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/ngx-slick-carousel/fesm2015/ngx-slick-carousel.mjs 329:10-19 Can't import the named export 'Component' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/ngx-slick-carousel/fesm2015/ngx-slick-carousel.mjs 438:10-19 Can't import the named export 'Directive' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/ngx-slick-carousel/fesm2015/ngx-slick-carousel.mjs 285:11-24 Can't import the named export 'ElementRef' from non EcmaScript module (only default export is available) ` Node version - 16.9.1 typescript - 4.0.8 Angular -10.2.5 Ngx-slick-Carousel - 0.6.0 tsconfig.json - target is updated from "es5" to "es2015" post upgrade of angular

P.S no webpack.config.ts in the project to do suggested changes like in this issue as well https://stackoverflow.com/questions/71054449/cant-import-the-named-export-directive-from-non-ecmascript-module-only-defau

hp1493 commented 1 year ago

issue resolved after update to Angular 12 , R.C could be due to target in tsconfig.json switch from es5 to es2015 pacakges