Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught TypeError: useValue,useFactory,data is not iterable! Angular 4 cli project error

I am new to Angular 4 , I have just created a project by Angular Cli and I get error as

Uncaught TypeError: useValue,useFactory,data is not iterable! 

enter image description here

I an unable to resolve it. I installed and reinstalled cli , I just want to know how can I resolve it. All I did was

ng new myprj 
 mkdir myprj 
 ng serve
like image 758
Kumar Pallav Avatar asked Jul 25 '17 10:07

Kumar Pallav


1 Answers

Such error usually happens if a browser is missing new features. Can be easily fixed by including polyfills

import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

To your vendor file or to file which start your tests in case you're switched in karma.config.js

   browsers: ['Chrome'] to browsers: ['PhantomJS']

Or getting this error after running ng test

like image 78
Denis Rybalka Avatar answered Oct 11 '22 09:10

Denis Rybalka