Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin is not defined #116

Open
gormlabenz opened this issue Dec 1, 2020 · 1 comment
Open

Plugin is not defined #116

gormlabenz opened this issue Dec 1, 2020 · 1 comment

Comments

@gormlabenz
Copy link

I installed the TTS Plugin:

"@ionic-native/text-to-speech": "^5.30.0",
"cordova-plugin-tts": "^0.2.3",

And used it in my vue file:

import { Plugins } from "@capacitor/core";
const { TextToSpeech } = Plugins;


...
methods: {
    tts(text) {
      TextToSpeech.speak(text)
        .then(() => console.log("Success Speach"))
        .catch((reason) => console.log(reason));
    },
...

console.log(TextToSpeech);

IOS
When I'm trying to use the plugin on IOS: I get an unknown error: error {}
When I'm printing the plugin, I get: [log] - undefined

Browser
When I'm trying to use the plugin it prints as expecting: TextToSpeech does not have web implementation.
When I'm printing the plugin, I get: Proxy {}

@gormlabenz
Copy link
Author

I found the solution.

first update @ionic-native/core

npm uninstall --save @ionic-native/core && npm install --save @ionic-native/core@latest

The import the plugin like this

import { TextToSpeech } from "@ionic-native/text-to-speech";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant