Camera plugin not working in Chromium browser (works in Firefox)

I’m currently going through the Ionic First App tutorial in Angular and I’m running into an issue where the camera plugin is not taking the picture in Chromium-based browsers (I tried Chome and the new Edge). I am able to pull up the viewfinder and have a preview of my image, but when I try to take the picture I get this message in the browser console: “Unable to take photo! DOMException: platform error. pwa-camera.entry.js:317”

This issue doesn’t exist in Firefox, which is confusing.

I cloned the tutorial app from the Ionic docs site (GitHub - ionic-team/tutorial-photo-gallery-angular: Photo Gallery Tutorial: Ionic Angular and Capacitor) and after running ‘npm install’ and serving the app, I get the same results.

Is there a known bug for the camera plugin for Capacitor 3? Not sure how else to troubleshoot this error.

1 Like

I just experienced the same issue with Capacitor 3.4.3

Same here using @capacitor/core 4.6.1 with @ionic/pwa-elements 3.1.1 and @capacitor/camera 4.1.4.

pwa-camera.entry.js?a9c6:449 Unable to take photo! DOMException: platform error

Trace:

eval @ pwa-camera.entry.js?a9c6:449
step @ pwa-camera.entry.js?a9c6:32
eval @ pwa-camera.entry.js?a9c6:13
rejected @ pwa-camera.entry.js?a9c6:5
Promise.then (async)
step @ pwa-camera.entry.js?a9c6:6
eval @ pwa-camera.entry.js?a9c6:7
__awaiter @ pwa-camera.entry.js?a9c6:3
class_1.capture @ pwa-camera.entry.js?a9c6:428
handleShutterClick @ pwa-camera.entry.js?a9c6:224

Works on Windows 10 Firefox v108 but not Chrome v108. It was also working in Chrome a week ago.