angularionic-frameworkcapacitorionic6

Cannot find module '@awesome-cordova-plugins/core' or its corresponding type declarations


I'm trying to use the in-app browser plugin with Ionic and capacitor. After Installing and using the plugin as per the documentation, I'm getting the following error:

[webpack-dev-server] ERROR
node_modules/@awesome-cordova-plugins/in-app-browser/ngx/index.d.ts:1:44 - error TS2307: Cannot find module '@awesome-cordova-plugins/core' or its corresponding type declarations.

1 import { AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';

Note that I've installed the plugin via:

npm install @awesome-cordova-plugins/core --save

I'm using Ionic 6.19 with @capacitor/core 4.6.3 and angular 15.1.4


Solution

  • Probably a CLI issue or bug. I just had to restart the CLI for this to work.

    I also noticed that for any of the awesome-cordova-plugins to work, you have to first install the core library via npm install @awesome-cordova-plugins/core --save. I installed this as an afterthought after installing the in-app browser plugin. Probably why I had to restart the CLI.