VUEJS - Why do I get: Uncaught TypeError: Right-hand side of 'instanceof'?

In my case, it was a component property that had a null type:

props: {
    role:{
      type: [String, null],
      required: true
    },

changing it to

props: {
   role:{
      type: String,
      required: true
   },

And making sure, that the component always gets a string, fixed the issue. I guess the combination of required and a possible null value was not very good...


Use:

props: {
  contentTypeUid: {
    type: String, // not 'string'
    required: false
  },
  limit: {
    type: Number, // not 'number'
    required: false,
    default: 10
  }
 },

Another case why this error might occur:

props: {
    prop_id: {
        required: true
    },
    title: 'Not specified'
},

So you need to change it to:

props: {
    prop_id: {
        required: true
    },
    title: {
        default: 'Not specified'
    }
},