1

I have vue project and i have installed few packages. When I do npm run dev it throws error for adding appropriate loader. It seems like packages I have installed have `optional-chaining code and babel coudlnt compile those files and code

Below are my files

this is my package.json

"devDependencies": {
    "@vue/cli-plugin-babel": "^3.0.0-rc.10",
    "@vue/cli-plugin-eslint": "^3.0.0-rc.10",
    "@vue/cli-plugin-unit-mocha": "^3.0.0-rc.10",
    "@vue/cli-service": "^3.0.0-rc.10",
    "@vue/test-utils": "^1.0.0-beta.20",
    "chai": "^4.1.2",
    "vue-template-compiler": "^2.5.16"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {
      "no-console": "off"
    },
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

this is vue.config.js file

  publicPath: process.env.NODE_ENV === 'production'
    ? '/'
    : '/',
    chainWebpack: config => {
      config.plugins.delete("prefetch");
    },
  devServer: {
      port: 9001
    }
}

and this is my babel.config.js file

  presets: [
    ['@vue/app',
    {useBuiltIns : "entry"}
]  ]
}

I have tried vue upgrade but didn't work Please let me know if anyone got a solution for this Thanks in advance :)

Moritz Ringler
  • 9,772
  • 9
  • 21
  • 34
Raj Patil
  • 11
  • 2

0 Answers0