I receive the following error:
INFO [karma]: Karma v0.13.9 server started at http://localhost:9018/
INFO [launcher]: Starting browser PhantomJS
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR
ReferenceError: Can't find variable: Map
at /Users/runtimeZero/code/vendor/inert/inert.min.js:589
I understand that I am including a file called inert.js which is using ES6 Map() . This is freaking out PhantomJs.
So I included core-js/es6/map.js polyfill in my karma config under files. However that does not resolve the issue.
Any tips ?
I think PhatomJS is not supporting ES6 Map, so you need to try with a polyfill,
I'm using babel polyfill npm install babel-polyfill --save-dev
files: [
{ pattern: 'node_modules/babel-polyfill/browser.js', instrument: false},
],
you need to install es6-shim and add it to your files section in karma config file.
npm install es6-shim --save
in your karma.config.js add it to your list of files
files: [
'node_modules/es6-shim/es6-shim.js'
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With