antonybudianto / angular-starter

:star: Gulp Angular Starter using TypeScript (Updated to 4.4.3)

Home Page:https://antonybudianto.github.io/angular-starter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PhantomJS support

talmog opened this issue · comments

Hi again,

I am trying to use phantomJS as a browser option.
I have installed karma-phantomjs-launcher and added phantomJS to the list of browsers.
I am getting this error:

 Error: 'undefined' is not a constructor (evaluating 'new exports.Map()')
    Error loading http://localhost:9876/angular2/src/platform/browser/browser_adapter
      at //node_modules/systemjs/dist/system.src.js:741
      at M (/node_modules/systemjs/dist/system-polyfills.js:4)
      at H (/node_modules/systemjs/dist/system-polyfills.js:4)
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/angular2/bundles/angular2-polyfills.js:493
      at /node_modules/angular2/bundles/angular2-polyfills.js:118
      at run (/node_modules/angular2/bundles/angular2-polyfills.js:138)
      at zoneBoundFn (/node_modules/angular2/bundles/angular2-polyfills.js:111)

any idea what is going on?
Thank you

I also tried using PhantomJS2 and still no luck, even after using es6-shim, not sure why it didn't support, I'll try it in next ng2 release

I've gotten PhantomJS2 to work with your starter by putting traceur-rungime and system-polyfills in karma.conf.js's files section:

{
    files: [
      'node_modules/traceur/bin/traceur-runtime.js', // Required by PhantomJS2, otherwise it shouts ReferenceError: Can't find variable: require

      {pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: true},
      {pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: true},
      {pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: true},
      {pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, watched: true},
      {pattern: 'node_modules/angular2/bundles/router.dev.js', included: true, watched: true},
      {pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, watched: true},
      {pattern: 'test/test-helpers/**/*.js', included: true, watched: true},
      {pattern: 'karma-test-shim.js', included: true, watched: true},
      {pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: false, watched: false }, // PhantomJS2 (and possibly others) might require it


      // paths loaded via module imports
      {pattern: 'app/**/*.js', included: false, watched: true},

      // paths loaded via Angular's component compiler
      // (these paths need to be rewritten, see proxies section)
      {pattern: 'app/**/*.html', included: false, watched: true},
      {pattern: 'app/**/*.css', included: false, watched: true},

      // paths to support debugging with source maps in dev tools
      {pattern: 'app/**/*.ts', included: false, watched: false},
      {pattern: 'app/**/*.js.map', included: false, watched: false}
    ]
}

thank you @zachallen !!!

that's great @zachallen , will add to master soon