PhantomJs:找不到变量映射 [英] PhantomJs: Can't find variable map
本文介绍了PhantomJs:找不到变量映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到以下错误:
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
我了解我包含了一个名为 inert.js的文件一个>使用ES6 Map().这吓坏了PhantomJs.
I understand that I am including a file called inert.js which is using ES6 Map() . This is freaking out PhantomJs.
所以我在我的业力配置文件中的文件中包含了core-js/es6/map.js polyfill.但是,这不能解决问题.
So I included core-js/es6/map.js polyfill in my karma config under files. However that does not resolve the issue.
有什么建议吗?
推荐答案
我认为PhatomJS不支持ES6 Map,因此您需要尝试使用polyfill,我正在使用babel polyfill npm install babel-polyfill --save-dev
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},
],
这篇关于PhantomJs:找不到变量映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文