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

[Bug] require('NativeModules').SpeechSynthesizer is undefined #1

Closed
JonathanWi opened this issue Sep 15, 2015 · 13 comments
Closed

[Bug] require('NativeModules').SpeechSynthesizer is undefined #1

JonathanWi opened this issue Sep 15, 2015 · 13 comments

Comments

@JonathanWi
Copy link

Hi,

Your plugin looks very promising, and I'd love to use it in my current project, but it seems that - since React core update (see facebook/react-native#1821 ), SpeechSynthesizer is not part of the core anymore.

When trying to install your plugin, I'm prompted with an error screen due tu SpeechSynthesizer not being part of NativeModules.

Any Ideas on how to fix this?

Cheers

@naoufal
Copy link
Owner

naoufal commented Sep 18, 2015

Looks like it's just a matter of updating the require.

Could you submit a PR if you have time? Otherwise, I'll tackle this over the weekend.

@JonathanWi
Copy link
Author

Hey thanks for the quick answer! I'm not sure how to update the require to be honest, would really appreciate if you have the time to do it!

Have a great week-end

@aportner
Copy link

I got this to work by following the instructions at: http://facebook.github.io/react-native/docs/linking-libraries-ios.html#content

there's an xcode project for the speech module that you drag in and add to your linker

@naoufal
Copy link
Owner

naoufal commented Sep 27, 2015

@aportner is there anything you think I should add to the readme to make it more helpful?

@aportner
Copy link

nope, I think that's good. this was the first react native module I used, so I'm glad you included those instructions.

@aportner
Copy link

maybe move the "Linking the Library" part of the readme under Installation?

@naoufal
Copy link
Owner

naoufal commented Sep 27, 2015

Thanks for the feedback @aportner.

@naoufal naoufal closed this as completed Sep 27, 2015
@joshbuchea
Copy link

I don't believe this issue was ever resolved. I am facing this same issue currently with React Native 0.14.2. The issue appears to be related to facebook/react-native#1821 like @JonathanWi stated initially.

I tried updating the require without success. It appears that NativeModules.SpeechSynthesizer does not evaluate to an object.

@nicholasalanbrown
Copy link

I'm having hte same problem @joshbuchea on 0.14.2.

@nicholasalanbrown
Copy link

Never mind, just got it working. This is the require update I had to make in SpeechSynethesizer.ios.js to get it to work:

var NativeSpeechSynthesizer = require('react-native').NativeModules.SpeechSynthesizer;
var invariant = require('react-native').invariant;

Note, this is not the same as the PR submitted by Yonas which reads like this:

var NativeSpeechSynthesizer = require('react-native').NativeModules;
// var invariant = require('invariant');
var invariant = require('react-native').invariant;

@aladante
Copy link

aladante commented Feb 9, 2016

Hey, still new to coding but got kind of the same problem as above. but updating the require in SpeechSynethesizer.ios.js didn't work for me. got the error

undefined is not an object('evaluating NativeSpeechSynthesizer .stopSpeakingAtBoundary')

any ideas ?

cheers

@allenmanning
Copy link

Did you rebuild your ios project in xcode?

@ksrawat
Copy link

ksrawat commented Feb 22, 2017

link the xcodeproj and re-run the app.. should work fine.. It works fine for me.

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

8 participants