I am having an issue with capacitor’s camera( I am using Vue if that matters). It was working in the past but now I am getting ChunkLoadError: Loading chunk node_modules_ionic_pwa-elements_dist_esm-es5_pwa-camera-modal_entry_js failed.
I’ve attempted to delete node_modules and run npm install, I’ve also noticed in main.ts when i comment out defineCustomElements(window);
It brings up my folder to select a photo. This is my takePhoto function that used to work:
const takePhoto = async () => {
try{
const photo = await Camera.getPhoto({
resultType: CameraResultType.Uri,
source: CameraSource.Camera,
quality: 100,
});
const fileName = Date.now() + '.jpeg';
const savedFileImage = {
id: Math.random(),
filepath: fileName,
webviewPath: photo.webPath,
is_featured: false
};
photos.value = [savedFileImage, ...photos.value];
updatePropertyImages(savedFileImage)
} catch (e){
console.log("No Photos taken");
}
};
return {
photos,
takePhoto,
};
I am not sure what else to do at this point. Could anyone please help? I can provide more info/code if needed.
Thank you