innFactory / react-native-dialogflow

A React-Native Bridge for the Google Dialogflow (API.AI) SDK
https://innfactory.de/softwareentwicklung/ui-ux/sprachsteuerung-mit-api-ai-in-einer-react-native-app/
MIT License
200 stars 64 forks source link

Authentication: Unexpected token o in JSON at position 1 #82

Open DavidKarasek opened 4 years ago

DavidKarasek commented 4 years ago

I suddenly started getting this error when initializing dialogflow,

react-native-dialogflow: Authentication Error: SyntaxError: Unexpected token o in JSON at position 1

Nothing has changed in the past 2 weeks with my implementation so I am not sure why I would suddenly get an error like this. I have tried blowing away node modules and reinstalling but it made no difference.

I am using V2, here is how I config:

    Dialogflow_V2.setConfiguration(
      config.client_email,
      config.private_key,
      Dialogflow_V2.LANG_ENGLISH_US,
      config.project_id
    )

I have doubled checked the data is correct before calling setConfiguration and it is fine,

Pei116 commented 4 years ago

I'm facing the same error even though all the configurations are set. @DavidKarasek were you able to fix it?