javascript - TypeError: core.defineInjectable is not a function while using angular materialcdk in angular 4.3.2 - Stack Overflo

I want to use angular material progress spinner and addedimport {MatProgressSpinnerModule} from '@

I want to use angular material progress spinner and added

import {MatProgressSpinnerModule} from '@angular/material';

Added in imports array and in ponent

Haven't tried both updating the template with selector and removing it. In either case getting the error.

I am using system.config.js, and added map values for all the angular material and cdk js files.

Using angular 4.3.2 and angular material latest version. Getting this below error.

errors.ts:42 ERROR Error: Uncaught (in promise): Error: TypeError: core.defineInjectable is not a function at eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:89:62) at Object.eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:91:2) Error loading http://localhost:8000/app/UMSClient//ipc/ums/modules/EnterpriseTree/Enterprise.module.js at eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:89:62) at Object.eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:91:2) Error loading http://localhost:8000/app/UMSClient//ipc/ums/modules/EnterpriseTree/Enterprise.module.js

What could be wrong?

Thanks,

I want to use angular material progress spinner and added

import {MatProgressSpinnerModule} from '@angular/material';

Added in imports array and in ponent

Haven't tried both updating the template with selector and removing it. In either case getting the error.

I am using system.config.js, and added map values for all the angular material and cdk js files.

Using angular 4.3.2 and angular material latest version. Getting this below error.

errors.ts:42 ERROR Error: Uncaught (in promise): Error: TypeError: core.defineInjectable is not a function at eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:89:62) at Object.eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:91:2) Error loading http://localhost:8000/app/UMSClient//ipc/ums/modules/EnterpriseTree/Enterprise.module.js at eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:89:62) at Object.eval (http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:91:2) Error loading http://localhost:8000/app/UMSClient//ipc/ums/modules/EnterpriseTree/Enterprise.module.js

What could be wrong?

Thanks,

Share Improve this question edited May 23, 2018 at 15:05 R. Richards 25.2k10 gold badges66 silver badges65 bronze badges asked May 23, 2018 at 14:57 RajeshRajesh 671 silver badge9 bronze badges 2
  • Can I ask why you're using SystemJS instead of WebPack with an Angular 4 project? – Reactgular Commented May 23, 2018 at 15:23
  • It is enterprise application already built with system js. We are planning to change to Webpack. – Rajesh Commented May 23, 2018 at 15:28
Add a ment  | 

2 Answers 2

Reset to default 5

defineInjectable is an angular 6 only function. You may have been using the newest version of Angular Material and it isn't patible with your current version (4.3.2).

I was getting this error on Stackblitz using Angular Material so I refreshed the dependancies and downgraded core-js to 2.6.9

core-js @ 2.6.9

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744350028a4569918.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信