After taking a photo using capacitor camera the App exits

Hi All,

I have an app built using ionic vue and capacitor 3 which uses the capacitor camera. As soon as the photo is taken the app exits. Also, I have plenty of space in my android which makes this scenario bit strange to me. Here’s my code… have I missed anything. Please point me in the right direction.

<template>
  <ion-page>
    <ion-header>
      <ion-toolbar color="primary">
        <img src="../assets/logo.svg" class="LogoSvg" />
      </ion-toolbar>
    </ion-header>
    <ion-content>
        <ion-img :src="image" v-if="image && !cameraActive"></ion-img>
      <ion-button @click="sendPhoto" expand="full" v-if="image && !cameraActive">Send</ion-button>
    </ion-content>
  </ion-page>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
import {
  IonPage,
  IonHeader,
  IonToolbar,
  IonContent,
  onIonViewWillEnter
} from "@ionic/vue";
import { useStore } from "vuex";
import { isEmpty, isNil } from "lodash";
import FileUploadBase64 from "@/dtos/FileUploadBase64";
import router from "@/router";
import { Camera, CameraDirection, CameraResultType, CameraSource } from '@capacitor/camera';

export default defineComponent({
    name: "Camera",
    components: {
        IonPage,
        IonHeader,
        IonToolbar,
        IonContent
    },
    setup() {
        const store: any = useStore();
        const image = ref("");
        const toOcr = ref("");
        const cameraActive = ref(false);

        const sendPhoto = async () => {
            if (image.value.length > 0) {
                const fileUpload = new FileUploadBase64();
                fileUpload.fileContent = toOcr.value.toString();
                // API call goes here

                router.push('/tabs/deceased');
            }
        };

         const takePhoto = async () => {
            cameraActive.value = true;
            const photo = await Camera.getPhoto({
                resultType: CameraResultType.Base64,
                source: CameraSource.Camera,
                quality: 100,
                direction: CameraDirection.Rear
            });
            const base64ImageResult = photo.base64String;
            if(!isNil(base64ImageResult) && !isEmpty(base64ImageResult)) {
                image.value = base64ImageResult;
                cameraActive.value = false;
            }
        };

        onIonViewWillEnter(async () => {
            await takePhoto();
        });

        return {
            image,
            toOcr,
            sendPhoto,
            cameraActive,
            takePhoto
        };
    }
});
</script>