peterfreeman / ngx-dropzone

A highly configurable dropzone component for Angular.
133 stars 58 forks source link

Can't import the named export #143

Closed satyamdorville closed 2 years ago

satyamdorville commented 2 years ago

Hello

I got this issue after installing the module :

Failed to compile.

./node_modules/ngx-dropzone/fesm2015/ngx-dropzone.mjs 600:53-65 Can't import the named export 'CommonModule' from non EcmaScript module (only default export is available)

My package.json :

  "name": "bwandy",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "node server.js",
    "start:dev": "ng serve",
    "build": "ng build --configuration=$ENVIRONMENT --build-optimizer && gzipper --verbose ./dist/bwandy",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.1.0",
    "@angular-devkit/build-angular": "^0.900.4",
    "@angular-slider/ngx-slider": "^2.0.3",
    "@angular/animations": "^9.0.4",
    "@angular/cdk": "^8.2.3",
    "@angular/cli": "^9.0.4",
    "@angular/common": "^9.0.4",
    "@angular/compiler": "^9.0.4",
    "@angular/compiler-cli": "^9.0.4",
    "@angular/core": "^9.0.4",
    "@angular/flex-layout": "^9.0.0-beta.29",
    "@angular/forms": "^9.0.4",
    "@angular/localize": "^11.0.9",
    "@angular/platform-browser": "^9.0.4",
    "@angular/platform-browser-dynamic": "^9.0.4",
    "@angular/router": "^9.0.4",
    "@angular/service-worker": "^9.0.4",
    "@ckeditor/ckeditor5-angular": "^1.2.3",
    "@ckeditor/ckeditor5-build-classic": "^18.0.0",
    "@fortawesome/angular-fontawesome": "^0.6.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.27",
    "@fortawesome/free-solid-svg-icons": "^5.12.1",
    "@fullcalendar/angular": "^4.4.5-beta",
    "@fullcalendar/daygrid": "^4.4.0",
    "@fullcalendar/interaction": "^4.4.0",
    "@fullcalendar/resource-timeline": "^4.4.0",
    "@fullcalendar/timegrid": "^4.4.0",
    "@ngx-translate/core": "^11.0.1",
    "@popperjs/core": "^2.6.0",
    "@types/googlemaps": "^3.43.2",
    "@types/jquery": "^3.3.33",
    "angular-split": "^3.0.3",
    "angular2-toaster": "^11.0.1",
    "angularx-qrcode": "^2.3.5",
    "angularx-social-login": "^4.0.1",
    "body-parser": "^1.19.0",
    "bootstrap": "^4.4.1",
    "browser-image-compression": "^1.0.14",
    "buffer": "^6.0.3",
    "chart.js": "^2.9.3",
    "datebook": "^2.0.3",
    "express": "^4.17.1",
    "file-saver": "^2.0.2",
    "font-awesome": "^4.7.0",
    "gzipper": "^3.5.0",
    "jquery": "^3.4.1",
    "konva": "^4.1.6",
    "localize": "^0.4.7",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.28",
    "ng-starrating": "^1.0.20",
    "ng2-charts": "^2.3.0",
    "ngx-chips": "^2.1.0",
    "ngx-dropzone": "^3.1.0",
    "ngx-pagination": "^5.0.0",
    "ngx-papaparse": "^4.0.4",
    "ngx-sortablejs": "^3.1.4",
    "parse": "^2.11.0",
    "rxjs": "^6.5.4",
    "sortablejs": "^1.10.2",
    "stripe": "^8.137.0",
    "tslib": "^1.11.1",
    "typescript": "^3.6.5",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@types/bootstrap": "^4.3.1",
    "@types/leaflet": "^1.5.9",
    "@types/node": "^17.0.17",
    "@types/sortablejs": "^1.10.4",
    "codelyzer": "^5.2.1",
    "nglint": "0.0.0",
    "source-map-explorer": "^2.5.2",
    "tslint-angular": "^3.0.2"
  },
  "engines": {
    "node": "12.14.0",
    "npm": "6.13.4"
  }
}
LukksMatthaus commented 2 years ago

Hi, I had the same issue and solved it by downgrading to version 3.0.0

satyamdorville commented 2 years ago

Ive done that and it is working (with also downgrading): Try changing target in the compilerOptions of your tsconfig.json from es5 to es2015

Thanks