After updating Laravel Mix to the latest version in my project, I started encountering Vue errors. One particular issue that I am struggling with involves a component I have created:
<template>
<div>
<ChildComponent :context="this"></ChildComponent>
</div>
</template>
<script>
import ChildComponent from './child-component';
export default {
components: { ChildComponent },
...
}
</script>
The specific error message I am seeing is:
Error in render: "TypeError: Cannot read property 'context' of undefined"
.
It's puzzling because when inspecting with vue-devtools, the parent component does show up as an object in the context
prop of ChildComponent.
Also worth mentioning, the context
prop is defined as context: {}
in ChildComponents's props.