Error: "Browser" plugin is not implemented on ios

Cannot open In-App Browser on iOS with Capacitor Browser Plugin.

The Plugin works well on Web, but when compiled to iOS and builded, throws an error on WebInspector: Unhandled Promise Rejection: Error: "Browser" plugin is not implemented on ios

import { Browser } from '@capacitor/browser';

export default defineComponent({
    setup(){{ url: ''}).then(() => {})
       //On Safari Developer Web Inspector, throws error

My setup:

Ionic CLI : 6.19.1 (C:\Users\Bruno\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/vue 6.2.6

Capacitor CLI : not installed
@capacitor/android : not installed
@capacitor/core : 4.1.0
@capacitor/ios : 4.1.0

cordova-res : not installed globally
native-run : not installed globally

NodeJS : v14.17.0 (C:\Program Files\nodejs\node.exe)
npm : 8.12.0
OS : Windows 10

Interesting. I am using it successfully in a Vue project on iOS :slight_smile:

What version of @capacitor/browser do you have installed?

The version is: 8.12.0

It’s really weird, because it works on Web, but not on the builded native version

That isn’t a valid version for @capacitor/browser. The latest version is only 4.0.1. You can run npm list to get currently installed versions of all packages.

Sorry, I’ve checked! It’s 4.0.1
Capacitor Core: 4.1.0
Ionic Vue: 6.2.6

Just for kicks, can you try just{ url: ''}) without the .then()?

If it still doesn’t work, can you provide a sample project with the issue in a public repo?

After rebuilding 5 times in a row, it’s seems to working now. It’s weird, because I’ve even restarted the computer and nothing. But now, only when I rebuilded 5 times in a row, it’s working!

1 Like

Probably reinstall the node_modules should work too…