Voltra / vue-player

A Vue port of react-player: components for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, DailyMotion and Kaltura.
MIT License
4 stars 1 forks source link

Invalid Prop #3

Open odion-cloud opened 1 week ago

odion-cloud commented 1 week ago

error [Vue warn]: Invalid prop: custom validator check failed for prop "config". at

my code

  <template>
    <VuePlayer url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" playing />
</template>

<script>
import { VuePlayer } from "@voltra/vue-player"
export default {
  name: 'Test',
  components: {
    VuePlayer
  }
}
</script>
Voltra commented 1 week ago

I'll take a look at this

Voltra commented 1 week ago

As per the testing I've been doing, it seems the current version of Vue 3 has a bug that only ignores validation if null is the value. When not providing the props, its value is undefined instead (which makes sense). What bugs me is that the default value doesn't seem to be used.

Looks like Vue 3 kinda forces you to use the composition API when writing components as defaults (or at the very least validation) don't work as they should.

Passing :config="null" does get rid of the error, but nothing is being rendered which I'm currently debugging

Voltra commented 1 week ago

In fact, passing null skips validation and doesn't use the defaults... that's very odd