angular-search-experience icon indicating copy to clipboard operation
angular-search-experience copied to clipboard

AOT build failing with error "Access token is required for new ApiAi.Client instance"

Open xmlking opened this issue 7 years ago • 3 comments

I am trying to configure my module using forRoot and data form environment like you did in this project. but getting following error. Error

 Error: Uncaught (in promise): ApiAiClientConfigurationError: Access token is required for new ApiAi.Client instance

wonder if you have any workaround for AOT build to make it work with forRoot https://github.com/sfeir-open-source/angular-search-experience/blob/master/src/app/core/core.module.ts#L19

xmlking avatar Aug 12 '18 21:08 xmlking

IIRC you need to create your own API key and change it here: https://github.com/sfeir-open-source/angular-search-experience/blob/master/src/environments/environment.ts#L17 but @manekinekko will know best

Haroenv avatar Aug 13 '18 07:08 Haroenv

@Haroenv is correct, this is due to a wrong access token being used for the dialogflow client. However, I'm gonna probably remove the easter egg part from the rest of the app.

In the meantime, you may wanna create a dialogflow account and use your own token. Here is how: https://dialogflow.com/docs/reference/agent#obtaining_access_tokens

manekinekko avatar Aug 13 '18 09:08 manekinekko

I am using my own key. If you uncomment line here , and run ng serve —aot , you can see the error. https://github.com/xmlking/ngx-starter-kit/blob/master/libs/dashboard/src/lib/dashboard.module.ts#L24

xmlking avatar Aug 13 '18 14:08 xmlking