[Solved] Vue Esline Error: Parsing error: Unexpected token import

// An error is reported when the component is imported asynchronously

Scenario: Vue routing lazy loading

1. Suspected reason: eslint verification is before Babel parsing

My final solution: add configuration in the eslint configuration file (.eslintrc.js)

"parserOptions": {
  "parser": "babel-eslint"

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *