angular-search-experience
angular-search-experience copied to clipboard
AOT build failing with error "Access token is required for new ApiAi.Client instance"
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
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 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
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