IBM-Cloud / insurance-bot

A message based insurance experience
http://cloudco.mybluemix.net
Other
36 stars 57 forks source link

unable to locate vcap local json #160

Closed sourabhks closed 7 years ago

sourabhks commented 7 years ago

I am getting error as { [Error: Cannot find module './vcap-local.json'] code: 'MODULE_NOT_FOUND' } although i have kept vcap-local.json in same path as of app.js and bot.js. Please help to fix the issue

rvennam commented 7 years ago

Can you provide a screenshot of your file structure and the contents of vcap-local.json

l2fprod commented 7 years ago

@sourabhks the vcap-local.json is only needed when you run the app locally. The error message is misleading as when running within Bluemix, the credentials for the database and the Watson service are retrieved from the VCAP_SERVICES automatically.

We should avoid trying to load a vcap-local.json when running in Bluemix or improve the error message.

sourabhks commented 7 years ago

Thanks fredrick for your prompt reply. I have one more query. I did some changes in your code and removed the benefit and claims details. So i ended up removing all their functions from app.js, ana.js, cloudco.js and the corresponding html. I now made up a new function replacing the getbenefit function which called userMessage to display the first conversation message on chatbot. I am now getting the chat response of chatbot in console.log with all intents, entities and conversation but I am not getting this on the chatbot. Instead I am getting error "I ran into error, could you please try again"

Please help to fix this issue if possible.

l2fprod commented 7 years ago

fixed the error message - it will only be shown if something is wrong with the vcap-local.json when it exists.

btw the screenshots you posted expose your credentials - you may want to remove them.

As per your issue, you likely removed something that was needed. Look at the console of the web browser, it should show a bit more information, something like "Server error for Conversation. Return status of....".

If that does not help debug your issue, I suggest you start over cloning the cloudco insurance with the toolchain https://github.com/IBM-Bluemix/insurance-toolchain then removing code step by step, ensuring the app still works after each step.