Today, I hit a really $&#% issue regarding Oracle Digital Assistant (ODA) Chatbot. This has to do with custom component feature. I find this error message misleading and leads to hours of troubleshooting efforts. So, it is better to share here for our further reference.

Oracle Solution
The typical cause for this error is that your component folders contain non-component files. The directories that you name in the
components
array in the main JavaScript file should point to directories that contain only component files. This includes files in any subdirectories.Say, for example, that the main JavaScript file sets the
components
array like the following code example. This statement tells the component service upload process to look in thecomponents
directory structure for the custom component definitions. The server will look at every file in the directory structure and try to process each one as a custom component. If there are files in that directory structure that aren’t custom components, the upload process fails because it can’t parse the file as a custom component.If you get this error, create a separate folder, such as
Source from Oraclehelpers
, in the same folder thatmain.js
is in. Then move the non-component files into it, and modify your code accordingly.
The Actual Error
The root cause I got from this error is JavaScript syntax error. While loading the custom component, the JavaScript with error is not identified as a component file. As such, it throws this error message in ODA.
Common Syntax Error
Reference to other JavaScript module must be within invoke function.
invoke: (context, done) => {
const fetch=require("node-fetch")
}
Be careful of syntax like semicolon after keepTurn. This will cause the same error message while loading of custom component.
context.transition('success')
context.keepTurn(true);
Hope these ODA tips helps and ease hours of frustration. Great thanks to Oracle Kevin for these!
That helped!thanks
LikeLike