Always see an error in your developer console? Below are the top 5 most common mistakes committed by SAPUI5 developers.
But first, do check out the some of the best practices in SAPUI5 Part1 and Part 2 to surely avoid these mistakes. 🙂
1. “sap is not defined”
The SAPUI5 runtime library, cannot be found or loaded by the application, due to incorrect directory or URL.
Replace the resource path in the
2. “failed to load Component.js”
The library cannot load the target
Component.js or the file is missing.
Find all instance of the namespace in your project and make sure to follow the correct namespace.
3. “Controller couldn’t be instantiated”
There are possible root causes for this error, and SAPUI5 doesn’t display enough information to debug.
First, is to check the controller’s namespace. Make sure it matches the view’s
controllerName. Then, make sure there are no syntax errors in the
Apply the correct namespace to the controller file.
4. “failed to load from: SyntaxError: Unexpected token )”
This happens if you forgot to close a block statement, which causes the rest of the script open-ended.
You can fix the syntax errors using the code highlighter of SAP Web IDE. In this case, we have a missing
"}" at line 8.
5. Translation entry does not show on the view
The first probable cause is that the
i18n property is not properly maintained. Secondly, it could be possible that the
i18ndoes not match with the property in the XML file.
The i18n property is missing.
The property does not match the XML view property.
Correctly maintain the i18n property file.
Is there any mistake you usually commit that’s not on the list? share it below.
And don’t forget to subscribe for more tips and tutorials for SAPUI5.