swimlane / ngx-dnd

🕶 Drag, Drop and Sorting Library for Angular2 and beyond!

Home Page:https://swimlane.github.io/ngx-dnd/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object (...) is not a function

Alesvetina opened this issue · comments

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Sorry, we will not be able to answer every support request.  Please consider other venues for support requests

Current behavior
When importing NgxDnDModule, i get an error:

swimlane-ngx-dnd.js:266 Uncaught TypeError: Object(...) is not a function
    at swimlane-ngx-dnd.js:266
    at Module../node_modules/@swimlane/ngx-dnd/fesm5/swimlane-ngx-dnd.js (swimlane-ngx-dnd.js:268)
    at __webpack_require__ (bootstrap:78)
    at Module../src/app/app.module.ts (app.component.ts:8)
    at __webpack_require__ (bootstrap:78)
    at Module../src/main.ts (main.ts:1)
    at __webpack_require__ (bootstrap:78)
    at Object.0 (main.ts:12)
    at __webpack_require__ (bootstrap:78)
    at checkDeferredModules (bootstrap:45)

I am importing like this:
import { NgxDnDModule } from '@swimlane/ngx-dnd';
and in Imports i have:

imports: [
  NgxDnDModule
]

package.json:

{
  "name": "setlist",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@swimlane/dragula": "^3.7.3",
    "@swimlane/ngx-dnd": "^6.0.0",
    "@types/dragula": "^2.1.34",
    "angular-inline-editors": "^1.0.2",
    "bootstrap": "^4.1.3",
    "core-js": "^2.4.1",
    "jquery": "^3.3.1",
    "ng-flash-messages": "^0.3.0",
    "ngx-click-to-edit": "0.0.7",
    "popper.js": "^1.14.5",
    "rxjs": "^5.5.6",
    "tslib": "^1.9.0",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.11.0",
    "@angular/cli": "^7.1.1",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.1",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

What am I doing wrong? Thank you for your help!

same issue here

you should npm install @swimlane/ngx-dnd@4.0.0 @swimlane/dragula @types/dragula --save.

I'm seeing the same thing - the repo seems to be on 8.0. Is there a reason we need to use v4 if v8 is current?

That's an old comment. Use v8.