Type check failed for prop "promise". Expected Promise, got Promise.
See original GitHub issueHello, thank you very much for the very useful project. The component works as expected, however I keep getting strange error on the console.
[Vue warn]: Invalid prop: type check failed for prop "promise". Expected Promise, got Promise.
I have no idea how this can become a problem since it’s exactly what the component expects, right? I am using Nuxt, if that matters, and here’s the code of my view:
<Promised :promise="checkImage(resto.pic)">
<div slot="pending">Loading...</div>
<v-card-media slot="then" slot-scope="data" :src="data" height="150px"/>
<v-card-media slot="catch" slot-scope="error" :src="error" height="150px"/>
</Promised>
Here’s the method which returns the promise:
checkImage(src) {
return new Promise((resolve, reject) => {
let img = new Image()
img.src = src
img.onload = () => resolve(src)
img.onerror = () => reject("/images/resto-placeholder.png")
})
}
Is there anything wrong on my end? Any help and feedback is greatly appreciated. Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
type check failed for prop "fetch". Expected Function, got ...
It means I have a promise in my function. It seems that fetch function is executed continuously and return same error you get....
Read more >[Vue warn]: Invalid prop: type check failed for prop "Items ...
You are expecting in v-data-table an array and with the async property, it will return a promise therefore you got that error.
Read more >type check failed for prop "value". expected array, got object ...
You are expecting in v-data-table an array and with the async property, it will return a promise therefore you got that error. If...
Read more >Vue.js - Invalid prop: type check failed for prop "src". Expected ...
Resolve the Promise when retrieving the image URL, before you pass it into your massage object. created() { try { db.collection('massages') .get() ...
Read more >type check failed for prop "data". Expected Object, got Array
I'm using laravel-vue-pagination getting this error Invalid prop: type check failed for prop "data". Expected Object, got Array. code is. Copy Code
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is because you are using a polyfill for Promises and it’s being included after VuePromised is included, making the type differ. The solution is making sure the polyfill is included before VuePromised. It had bit me before, so I will probably just use a custom validator that checks for
thenandcatchmethodsoh, I’m sorry I don’t have a different solution in mind apart from the one I implemented in vue-promised