SortableJS / ngx-sortablejs

Angular 2+ binding to SortableJS. Previously known as angular-sortablejs
https://sortablejs.github.io/ngx-sortablejs/
MIT License
465 stars 160 forks source link

Object(...) is not a function at Module../node_modules/ngx-sortablejs/fesm5/ngx-sortablejs.js #167

Open karanpatel7193 opened 5 years ago

karanpatel7193 commented 5 years ago

ngx-sortablejs.js:178 Uncaught TypeError: Object(...) is not a function at ngx-sortablejs.js:178 at Module../node_modules/ngx-sortablejs/fesm5/ngx-sortablejs.js (ngx-sortablejs.js:180) at webpack_require (bootstrap:83) at Module../src/app/app.module.ts (app.model.ts:36) at webpack_require (bootstrap:83) at Object../src/main.ts (main.ts:4) at webpack_require (bootstrap:83) at Object.0 (main.ts:12) at webpack_require (bootstrap:83) at checkDeferredModules (bootstrap:45)

I am getting below warning in cmd while runing

WARNING in ./node_modules/ngx-sortablejs/fesm5/ngx-sortablejs.js 178:59-77 [ng] "export 'ɵɵdefineInjectable' was not found in '@angular/core'

My Version in package.json file

    "@angular/animations": "^8.1.1",
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "ngx-sortablejs": "^3.0.0",
    "sortablejs": "^1.9.0",
superphilharris commented 5 years ago

This error is due to the version of typescript that you have in your package.json. I resolved this issue by upgrading typescript to 3.4

karanpatel7193 commented 5 years ago

If I upgrading typescript version to 3.4 I am getting below error.

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.4.1 was found instead.

All my dev dependency versions as below

    "@angular-devkit/architect": "~0.13.8",
    "@angular-devkit/build-angular": "~0.13.8",
    "@angular-devkit/core": "~7.3.8",
    "@angular-devkit/schematics": "~7.3.8",
    "@angular/cli": "~7.3.8",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.5.1",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~12.0.0",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~8.3.0",
    "tslint": "~5.17.0",
    "typescript": "^3.2.4"

It looks like I have to upgrade angular compiler version. But will it work properly or mashup project?

gethari commented 5 years ago

Did you solve this ? I am facing this now

gethari commented 5 years ago

This error is due to the version of typescript that you have in your package.json. I resolved this issue by upgrading typescript to 3.4

I don't think so, this is working on a stackblitz demo app with typescript 3.1.1

https://stackblitz.com/edit/angular-8wg78w

gethari commented 4 years ago

If I upgrading typescript version to 3.4 I am getting below error.

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.4.1 was found instead.

All my dev dependency versions as below

    "@angular-devkit/architect": "~0.13.8",
    "@angular-devkit/build-angular": "~0.13.8",
    "@angular-devkit/core": "~7.3.8",
    "@angular-devkit/schematics": "~7.3.8",
    "@angular/cli": "~7.3.8",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.5.1",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~12.0.0",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~8.3.0",
    "tslint": "~5.17.0",
    "typescript": "^3.2.4"

It looks like I have to upgrade angular compiler version. But will it work properly or mashup project?

Did you solve this problem ?

faustlifes commented 4 years ago

I have the same error, but I can't to upgrade angular to 8v, there are a lot of dependency issues which I need to solve...

smnbbrv commented 4 years ago

If you guys can't use v8 then simply use older version of this lib angular-sortablejs@^2.0.0 in combination with sortable@1.9.0

robinGiri commented 4 years ago

Same problem here .. any solutions WARNING in ./node_modules/ngx-sortablejs/fesm5/ngx-sortablejs.js 179:59-77 "export 'ɵɵdefineInjectable' was not found in '@angular/core'

calibar commented 4 years ago

If you guys can't use v8 then simply use older version of this lib angular-sortablejs@^2.0.0 in combination with sortable@1.9.0

Solved my case. Thx

pmaganti commented 3 years ago

If you guys can't use v8 then simply use the older version of this lib angular-sortablejs@^2.0.0 in combination with sortable@1.9.0

It would be good to have the README updated to have this clause instead saying Angular 2+ binding since the latest version only support for Angular 7+ (I believe. Tested in 5 and it didn't work)