3***@qq.com
3***@qq.com
  • 发布:2022-09-20 12:00
  • 更新:2022-09-23 12:07
  • 阅读:425

vue create -p dcloudio/uni-preset-vue my-project 创建后报exports is not defined

分类:uni-app

用这个创建脚手架项目后, 执行npm run serve 跑起来后, h5环境报 :

Uncaught ReferenceError: exports is not defined
at Module.1541 (chunk-vendors.js:22337)
at webpack_require (index.js:397)
at fn (index.js:653)
at eval (637:5)
at Object.637 (index.js:344)
at
webpack_require
(index.js:397)
at index.js:1578
at Function.__webpack_require__.O (index.js:443)
at index.js:1579
at index.js:1581

2022-09-20 12:00 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

node 16.3.0 默认模板未复现该问题
提供下环境配置及选择的模板,检查下是否是本地环境问题

9***@qq.com

9***@qq.com

我遇到了相同的问题

Uncaught ReferenceError: exports is not defined  
    at 1541 (chunk-vendors.js:22337:23)  
    at __webpack_require__ (index.js:397:33)  
    at fn (index.js:653:21)  
    at eval (637:5:45)  
    at 637 (index.js:368:1)  
    at __webpack_require__ (index.js:397:33)  
    at index.js:1578:109  
    at __webpack_require__.O (index.js:443:23)  
    at index.js:1579:53  
    at index.js:1581:12
  • DCloud_UNI_WZF

    测试工程发下

    2022-09-23 10:15

  • 9***@qq.com

    回复 DCloud_UNI_WZF: 怎么发的 就是空模板 没动过 运行serve 浏览器就报这错 模板也渲染不出来

    2022-09-23 10:19

DCloud_UNI_WZF

DCloud_UNI_WZF

使用 yarn 安装依赖或注释掉 babel.config.js 中的 modules: 'commonjs'

要回复问题请先登录注册