imengyu / vue3-context-menu

A very simple context menu component for Vue3 一个简洁美观简单的Vue3右键菜单组件

Home Page:https://docs.imengyu.top/vue3-context-menu-docs/en/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

启动报错 Module parse failed

serious-snow opened this issue · comments

使用yarn 安装的,版本 "@imengyu/vue3-context-menu": "^1.3.5",

main.js
import ContextMenu from '@imengyu/vue3-context-menu' app.use(ContextMenu)
yarn serve 直接报错

报错信息如下:
`$ yarn serve
yarn run v1.22.18
$ vue-cli-service serve
INFO Starting development server...
98% after emitting CopyPlugin

ERROR Failed to compile with 1 error 22:30:24

error in ./node_modules/@imengyu/vue3-context-menu/lib/vue3-context-menu.umd.js

Module parse failed: Unexpected token (1:12852)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

(function(W,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(W=typeof globalThis<"u"?globalThis:W||self,e(W["vue3-context-menu"]={},W.V
ue))})(this,function(W,e){"use
`

已解决,从vue-cli换成vite就可以了