Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

直接引用打包后的js文件报错 The requested module '/node_modules/.vite/vue.js?v=4faa665e' does not provide an export named 'default' #32

Open
yyrjlw opened this issue Apr 2, 2024 · 3 comments

Comments

@yyrjlw
Copy link

yyrjlw commented Apr 2, 2024

呈现步骤:

  • 克隆本项目
  • npm install
  • npm run lib
  • 新建vue工程 并安装依赖
  • 将打包后的dist文件夹中的内容复制到新工程的src/libs目录
  • 新工程main.js引入js文件与css文件
    import variant from "./lib/dist/designer.es.js";
    import "./lib/dist/designer.style.css";
    createApp(App).use(variant).mount("#app");
  • npm run dev 打开网页报错designer.es.js:20 Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=4faa665e' does not provide an export named 'default' (at designer.es.js:20:8)
@vform666
Copy link
Owner

vform666 commented Apr 7, 2024

注意按文档操作,路径必须@开头:
https://www.yuque.com/visualdev/vform3/ohyr5i

@weikangrong
Copy link

VForm2也会出现这个问题 The requested module '/lib/vform/VFormDesigner.umd.min.js' does not provide an export named 'default',根据文档步骤操作的

@yfzhangCode
Copy link

添加@引入包后报错:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants