- Type 1 – Getting undefined is not an object error
This error occurs when the user tries to use a variable before it is defined in Smartcode or Directcode
- In the above Smartcode, the userName variable is defined from the value of the username textbox.
- Alert will be displayed with username using the value of the userName variable
- In preview, the Showalert method could have been called before assigning value to the userName variable.
- In such cases, undefined is not an object error will be displayed.
- To avoid this error, the user should use the variable in the success block itself.
This error occurs when Resetpagestate is not working i.e StyleJson is not refreshed.
- Type – 2 – Getting undefined is not a function error
This error occurs when the user tries to map particular variable values to the control before it is defined using Smartcode or Directcode
- In this example, Picker data is loaded on page load using the cityList variable.
- In preview, if cityList variable is empty, then undefined is not a function error will be displayed.
- Type – 3 – Getting Name or Service not Known Error while trying to take a build
This error occurs while taking a build, if the Workspace Domain ID is deleted or removed from the Host provider. Create the Domain ID which is same as that is available in the Host provider to resolve this issue.