universalModuleDefinition:1 Uncaught (in promise)
时间: 2023-10-29 11:18:10 浏览: 143
TypeError: Cannot read properties of undefined (reading '_c')这个错误是因为在Vue3中直接安装vue-cropper会导致的问题。解决这个问题的方法是在vite.config.ts中的defineConfig里的define添加global:{}。这样就可以解决这个报错了。
此外,如果你使用的是vue-cropper@next版本,还需要引入样式import 'vue-cropper/dist/index.css'。通常情况下,使用vue-cropper时搭配的是vue2和vue-cropper,或者是vue3和vue-cropper@next。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [vue3中使用vue-cropper剪裁上传图片报错:Universal Module Definition](https://blog.csdn.net/qq_40588529/article/details/127907662)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Uncaught ReferenceError: global is not defined (has-symbols)](https://blog.csdn.net/weixin_45610757/article/details/122493294)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文