Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'then')
时间: 2023-10-19 10:33:42 浏览: 172
Vue打包Cannot read property 'tapPromise' of undefined报错处理.docx
5星 · 资源好评率100%
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'then') 错误是由于在调用.then()方法之前,出现了一个undefined的对象,导致无法读取属性。这个错误通常发生在Promise链式调用中。根据提供的引用内容,我们可以看到这个错误可能是在queGetdata函数中出现的。和中都提到了这个错误的解决方法,即将resolve()放在commit()方法之前。这是因为在Promise的then()方法中,如果在commit()之前调用resolve(),则会在后续的处理中出现undefined的错误。通过将resolve()放在commit()之前,可以确保在commit()被调用之前,Promise已经成功地执行了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [ASP.NET MVC运行出现Uncaught TypeError: Cannot set property __MVC_FormValidation of null的解决方法](https://download.csdn.net/download/weixin_38731761/13069683)[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* *3* [Uncaught (in promise)和Uncaught (in promise) TypeError: Cannot read properties of undefined (readin](https://blog.csdn.net/weixin_40476233/article/details/126107676)[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 ]
阅读全文