question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type check failed for prop "promise". Expected Promise, got Promise.

See original GitHub issue

Hello, 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
posvacommented, Aug 15, 2018

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 then and catch methods

0reactions
posvacommented, Jul 9, 2019

oh, I’m sorry I don’t have a different solution in mind apart from the one I implemented in vue-promised

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found