I. Problem description

This is because the project will run on XP, the latest version of Chrome available for XP is version 49, and the latest version of Firefox is version 52. The project runs with an error on both versions, but works fine on older browsers.

Error message in Chrome 49: (Uncaught SyntaxError: Unexpected Token…)

FireFox 52 displays the following error message: (SyntaxError: Invalid property ID)

Second, problem solving process

1. Try installing Babel-Polyfill

Uncaught SyntaxError: Unexpected Token… Babel compilation does not compile async/await by default, it is not converted to ES5, so it is not compatible with earlier versions of the browser and cannot parse properly.

As prompted, try installing the plug-in babel-Polyfill to modify the configuration information:

npm install babel-polyfill --save
Copy the code

In main.js it is introduced as follows, at the very top of the code

require('babel-polyfill');
Copy the code

or

import 'babel-polyfill';
Copy the code

But after running the test or error, can not be resolved. Therefore, the plug-in Babel-Polyfill cannot solve the compatibility problem of my project. There should be other compatibility problems, which need to be solved further.

2. Resolve the problem by removing incompatible plug-ins or reducing the version

The basic vue project can run properly in Chrome 49 and Firefox 52, so it is suspected that this project references incompatible plug-ins. At this time, we have to use the elimination method, through the error message, go to the corresponding file to delete and exclude the comparison. Finally, it was determined that the project could run normally as long as the reference of fuse.js was removed. However, no other problems were found in the deletion of the reference of fuse.js, so the compatibility problem was solved temporarily.

Elimination method is more commonly used to find the error of the method, when can not immediately locate the problem where, might as well try elimination method, constantly delete delete delete, perhaps to find out the error.

Summary: Compatibility is basically a syntax problem, may be part of the plug-in does not match, reduce the version or simply do not use this plug-in may be on the line

Just this.