Uncaught TypeError promisethenthencatch is not a function
This error occurs when you try to chain a then() or catch() method on a promise that doesn't return a promise object. You should make sure that the promise object returned by the previous then() method is valid and returns a promise object.
Here are some possible reasons why you might be getting this error:
-
The promise object is undefined or null: Make sure that the promise object you are trying to chain the
then()orcatch()method on is notundefinedornull. -
The promise object is not returned: Make sure that the promise object returned by the previous
then()method is valid and returns a promise object. If the previousthen()method doesn't return a promise object, you won't be able to chain thethen()orcatch()method. -
The promise object is not asynchronous: Make sure that the promise object you are trying to chain the
then()orcatch()method on is an asynchronous one. If the promise object is synchronous, you won't be able to chain thethen()orcatch()method.
To fix this error, you should check the code that returns the promise object and make sure that it's returning a valid promise object. You can also add some error handling code to catch any potential errors that might occur during the promise chain
原文地址: http://www.cveoy.top/t/topic/cv4U 著作权归作者所有。请勿转载和采集!