Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

useValue,useFactory,data is not iterable! (Angular4) #205

Open
cacothi opened this issue Aug 10, 2017 · 3 comments
Open

useValue,useFactory,data is not iterable! (Angular4) #205

cacothi opened this issue Aug 10, 2017 · 3 comments

Comments

@cacothi
Copy link

cacothi commented Aug 10, 2017

Hi Guys,

I've tries to use PhantomJS on Karma / AnagularJS and got the following error:

`
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
TypeError: useValue,useFactory,data is not iterable!
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:854
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
TypeError: useValue,useFactory,data is not iterable!
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:854

PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
TypeError: useValue,useFactory,data is not iterable!
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:854
`

Basically, I´ve done the following steps:

  1. ng new my-app
  2. ng eject
  3. npm install --save-dev karma-phantomjs-launcher
  4. changed the karma.config

`
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-phantomjs-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['PhantomJS'],
singleRun: true
});
};
`

  1. npm test

Am I missing something else?

"devDependencies": { "@angular/cli": "1.2.7", "@angular/compiler-cli": "^4.0.0", "@angular/language-service": "^4.0.0", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "autoprefixer": "^6.5.3", "codelyzer": "~3.0.1", "css-loader": "^0.28.1", "cssnano": "^3.10.0", "exports-loader": "^0.6.3", "file-loader": "^0.10.0", "html-webpack-plugin": "^2.19.0", "istanbul-instrumenter-loader": "^2.0.0", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-phantomjs-launcher": "^1.0.4", "less-loader": "^4.0.2", "postcss-loader": "^1.3.3", "postcss-url": "^5.1.2", "protractor": "~5.1.2", "raw-loader": "^0.5.1", "sass-loader": "^6.0.3", "script-loader": "^0.7.0", "source-map-loader": "^0.2.0", "style-loader": "^0.13.1", "stylus-loader": "^3.0.1", "ts-node": "~3.0.4", "tslint": "~5.3.2", "typescript": "~2.3.3", "url-loader": "^0.5.7", "webpack": "~2.4.0", "webpack-dev-server": "~2.4.5" }

@AlexanderSuv
Copy link

It looks like Phantomjs require browser polyfills (in polyfills.ts):

/***************************************************************************************************
 * BROWSER POLYFILLS
 */

/** IE9, IE10 and IE11 requires all of the following 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';

@vlad-ovsyannikov
Copy link

I am trying to use phantomjs for pdf rendering - got the same issue as above - after enabling polyfills have new error:

info: ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'Users/..

all routes are broken to paths to template files - any ideas?

@skryvets
Copy link

@vlad-ovsyannikov,

I faced a similar problem. Please make sure that you enabled all polyfills and installed packages required by those polyfills, i.e.:

npm install --save classlist.js intl web-animations-js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants