Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Ionic 4 No provider for SecureStorage

$
0
0

@jfsoftwarellc wrote:

Converting my v3 app to v4 and stopped up at getting SecureStorage to work. Currently testing in the browser so not sure if this is just browser specific or not but in v3 it worked on any platform.

Full error from the browser console:

ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[SecureStorage]: 
  StaticInjectorError(Platform: core)[SecureStorage]: 
    NullInjectorError: No provider for SecureStorage!

Haven’t done anything beyond installing the plugin
ionic cordova plugin add cordova-plugin-secure-storage
npm install @ionic-native/secure-storage

and then importing it adding it to the constructor per the docs page

import { SecureStorage, SecureStorageObject } from '@ionic-native/secure-storage/ngx';

constructor(private secureStorage: SecureStorage) { }

Not even 100% sure why it’s showing the platform as core instead of browser. I tried messing with the securestorage.js file in /plugins/cordova-plugin-secure-storage/www to add ‘browser’ and ‘core’ to the array of supported platforms, then adding an if statement on browser or core to overwrite the SecureStorage prototype with the plugin code form v3 that uses localStorage but that didn’t seem to do anything at all so I reverted it.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>