Uncaught TypeError: _vue2.default is not a constructor

问题描述 投票:0回答:0

我正在使用 webpack 使用 mevn 构建应用程序,但我遇到了这个错误 “未捕获的类型错误:_vue2.default 不是构造

enter image description here

enter image description here

{
  "name": "mevn-curso",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "nodemon src/index.js",
    "webpack": "webpack --mode development --watch"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.18.2",
    "mongoose": "^7.0.4",
    "morgan": "^1.10.0",
    "vue": "^3.2.47"
  },
  "devDependencies": {
    "babel-loader": "^9.1.2",
    "babel-preset-env": "^1.7.0",
    "vue-loader": "^17.1.0",
    "vue-template-compiler": "^2.7.14",
    "webpack": "^5.81.0",
    "webpack-cli": "^5.0.2"
  }
}

我尝试以不同的方式导入 vue 但它没有用

node.js vue.js webpack bundle
© www.soinside.com 2019 - 2024. All rights reserved.