I am working on a Prismic site which is built with Vue that I've taken over.
All of this has been working before but stopped working probably a couple of months ago.
There is a newslisting page on the site which is called "SliceUpdate.vue" which looks like this:
<template>
<div class="slice-update">
<div class="updates" v-match-heights="{el: ['.slice-update h3', '.slice-update h4', '.slice-update h5', '.slice-update .text'] }">
<div v-for="(update, index) in reverseUpdates" :key="update.id" class="update">
<template v-if="index <= updatesToShow -1">
<update :part="update" />
</template>
</div>
<div class="load-more" v-if="updatesToShow < totalUpdates">
<a href="#" @click.prevent.stop="showMore()">{{ $t('ns.load_more') }}</a>
</div>
</div>
</div>
</template>
<script>
import update from '~/components/part/partUpdate.vue'
export default {
props: ['slice'],
components: {
update
},
name: 'slice-update',
data() {
return {
updatesToShow: 12,
totalUpdates: 0,
trigger: 0
};
},
computed: {
reverseUpdates() {
return this.slice.items.slice().reverse();
}
},
methods: {
showMore() {
this.updatesToShow += 2
// Trigger vue-match-heights
setTimeout(() => {
window.dispatchEvent(new Event('resize'));
},10);
}
},
mounted() {
this.totalUpdates = this.slice.items.length
}
}
</script>
`And inside of this it's picking up the "partUpdate.vue" file which looks like this:
<template>
<div class="part-update">
<figure :style="{ backgroundImage: 'url(' + part.image.url + ')', backgroundPosition: ''+ part.image_focus +'' }"></figure>
<prismic-rich-text class="header" :field="part.header"/>
<div class="text">
<div class="text-part">
<prismic-rich-text class="header" :field="part.text"/>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['part'],
}
</script>
Suddenly now the update page is showing "Missing Stack Frames" and I get a npm error saying:
ERROR [Vue warn]: Error in render: "TypeError: Cannot read properties of null (reading 'substring')" 12:16:15
found in
---> <Update> at components/part/partUpdate.vue
<SliceUpdate> at components/slices/SliceUpdate.vue
<SlicesBlock> at components/SiteSlices.vue
<Page> at pages/page/_uid.vue
<Nuxt>
<Layouts/default.vue> at layouts/default.vue
<Root>
I've tried a couple of things and narrowed down to that if I remove this line:
<prismic-rich-text class="header" :field="part.text"/>
Everything works except I don't see any text of course.
So it can load in all other fields except for the text-field, and I've double checked the name and that's correct.
I can't for my life understand what's wrong and what to even start looking at. Could someone point me in the right direction?
Thank you!