Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing the es6-promise polyfill into Vue.js

I am having problems loading a Vue component containing axios in older version of Android. After some research it pointed towards the browser not supporting Promises, hence the polyfill.

I have installed and imported the polyfill but still having problems.

import Promise from 'es6-promise';

Is the above correct? Or is there a further problem?

like image 253
James Parsons Avatar asked Feb 17 '17 22:02

James Parsons


1 Answers

I have following line on top of my main.js:

require('es6-promise').polyfill()

other variant of it's use you can see in vue-hackernews-2.0 here:

import 'es6-promise/auto'
like image 104
Saurabh Avatar answered Oct 20 '22 23:10

Saurabh