base64Data does not exist on type 'CameraPhoto'

Hi I am following a course on udemy and couldnt find the answers there, I am using ionic 4 angular and upon trying to save I saw this error, TS2339 Property ‘base64Data’ does not exist on type ‘CameraPhoto’.

error in my code is:

full script below

import {
Component,
OnInit,
Output,
EventEmitter,
ViewChild,
ElementRef
} from ‘@angular/core’;
import {
Plugins,
Capacitor,
CameraSource,
CameraResultType
} from ‘@capacitor/core’;
import { Platform } from ‘@ionic/angular’;

@Component({
selector: ‘app-image-picker’,
templateUrl: ‘./image-picker.component.html’,
styleUrls: [’./image-picker.component.scss’]
})
export class ImagePickerComponent implements OnInit {
@ViewChild(‘filePicker’, {static: true}) filePickerRef: ElementRef;
@Output() imagePick = new EventEmitter<string | File>();
selectedImage: string;
usePicker = false;

constructor(private platform: Platform) {}

ngOnInit() {
console.log(‘Mobile:’, this.platform.is(‘mobile’));
console.log(‘Hybrid:’, this.platform.is(‘hybrid’));
console.log(‘iOS:’, this.platform.is(‘ios’));
console.log(‘Android:’, this.platform.is(‘android’));
console.log(‘Desktop:’, this.platform.is(‘desktop’));
if (
(this.platform.is(‘mobile’) && !this.platform.is(‘hybrid’)) ||
this.platform.is(‘desktop’)
) {
this.usePicker = true;
}
}

onPickImage() {
if (!Capacitor.isPluginAvailable(‘Camera’)) {
this.filePickerRef.nativeElement.click();
return;
}
Plugins.Camera.getPhoto({
quality: 50,
source: CameraSource.Prompt,
correctOrientation: true,
height: 320,
width: 200,
resultType: CameraResultType.Base64
})
.then(image => {
this.selectedImage = image.base64Data;
this.imagePick.emit(image.base64Data);
})
.catch(error => {
console.log(error);
if (this.usePicker) {
this.filePickerRef.nativeElement.click();
}
return false;
});
}

onFileChosen(event: Event) {
const pickedFile = (event.target as HTMLInputElement).files[0];
if (!pickedFile) {
return;
}
const fr = new FileReader();
fr.onload = () => {
const dataUrl = fr.result.toString();
this.selectedImage = dataUrl;
this.imagePick.emit(pickedFile);
};
fr.readAsDataURL(pickedFile);
}
}

Make sure your capacitor version is up to date; as it looks like that field was added in this commit.

Thank you for your reply I used CameraResultType.DataUrl instead of CameraResultType.Base64 which seems to work okay

how did you solve it while displaying image in dom and also uploading to server? Please share your code I need help