ngx-sortablejs icon indicating copy to clipboard operation
ngx-sortablejs copied to clipboard

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

Open karanpatel7193 opened this issue 6 years ago • 10 comments

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",

karanpatel7193 avatar Jul 20 '19 07:07 karanpatel7193

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

superphilharris avatar Jul 21 '19 21:07 superphilharris

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?

karanpatel7193 avatar Jul 22 '19 05:07 karanpatel7193

Did you solve this ? I am facing this now

gethari avatar Jul 30 '19 09:07 gethari

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 avatar Jul 30 '19 09:07 gethari

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 ?

gethari avatar Jul 31 '19 06:07 gethari

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...

faustlifes avatar Jul 31 '19 12:07 faustlifes

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

smnbbrv avatar Jul 31 '19 12:07 smnbbrv

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'

robinGiri avatar Aug 30 '19 07:08 robinGiri

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

Solved my case. Thx

calibar avatar Mar 27 '20 06:03 calibar

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

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)

pmaganti avatar Sep 07 '20 09:09 pmaganti