About Android h5 embedded web TypeError:Object.entries is not a function

Source: Internet
Author: User

Android Embedded page has a tab click actually did not respond, dizzy. But fortunately only in the hands of the Meizu phone has a problem, Huawei can, basically can be identified as compatibility issues

Use Devtools to view WebView Web page to see error messages such as

It is obvious that ES6 's generators entries function is not supported, then check the phone's Chrome kernel version is 51, check the Android chrome kernel compatibility, such as Android Chrome compatibility update so slow.

Solve, originally thought is babel compile turn es5 problem, did a half day not. Finally look at the answer of the great God to discover: Babel can only translate the syntactic sugars during the build process, such as translating the grammatical parts of es7/es6/jsx (such as the arrow functions) into ES5. And Polyfill is the problem of solving the native object, for example, your browser does not support Promise,babel will build you a promise for you to use. This makes it clear that you can add Babel-polyfill when Webpack is built.

Two-step

1. Installation Module

NPM Install--save Babel-polyfill

2. Configuration module

Webpack.config.js in entry plus Polyfill (I'm here to create a project with VUE-CLI, the Webpack profile name is webpack.base.conf.js. Polyfill Direct Main.js in the import can also, just introduce the way different)

entry: {  ' babel-polyfill ': ' Babel-polyfill ',  './main.js '},

About Android h5 embedded web TypeError:Object.entries is not a function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.