Search code examples
sapui5

Loading changes for Component failed


When I start the app, I've got the following error message:

Loading changes for ZMM_CLASSIFICATION.Component failed! Error code: 404

It happens because of the smartFilterBar:

<smartFilterBar:SmartFilterBar id="SelectionFilterBar" entitySet="ZMM_C_CLASSIFICATION" search="onSearchClass">
    <smartFilterBar:controlConfiguration>
        <smartFilterBar:ControlConfiguration key="ClassType" preventInitialDataFetchInValueHelpDialog="false"></smartFilterBar:ControlConfiguration>
        <smartFilterBar:ControlConfiguration key="ClassNum" preventInitialDataFetchInValueHelpDialog="false"></smartFilterBar:ControlConfiguration>
    </smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>  

The network traffic shows:

enter image description here

It seems, that an interface could not be reached.

What am I doing wrong?
Hint: Starting the app at the first time, everything works as expected. After refreshing the app, I received the error.

The content of the component file:

sap.ui.define([
    "sap/ui/core/UIComponent",
    "sap/ui/Device",
    "ch/mindustrie/ZMM_CLASSIFICATION/model/models"
], function (UIComponent, Device, models) {
    "use strict";

    return UIComponent.extend("ch.mindustrie.ZMM_CLASSIFICATION.Component", {

        metadata: {
            manifest: "json"
        },

        /**
         * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
         * @public
         * @override
         */
        init: function () {
            // call the base component's init function
            UIComponent.prototype.init.apply(this, arguments);

            // enable routing
            this.getRouter().initialize();

            // set the device model
            this.setModel(models.createDeviceModel(), "device");
        }
    });
});

Update

I debugged the app and saw:

enter image description here

UI5 try to download appversion and it failed.


Solution

  • If you received the following 2 errors in your SAPUI5 application in the WEBIDE environment regarding missing of /appconfig/fioriSandboxConfig.json and Loading changes for ...Component failed as shown in the following picture:

    Error messages in console output

    Then simply add the following .json files with empty body - only put {} as the content in the *.json files- and then you will not see the errors anymore.

    1. Beside of the webapp folder create a new folder and name it appconfig, then inside of this new folder create a new file and name it fioriSandboxConfig.json, and finally add {} as the content of the json file.
    2. Beside of the Component.js file create a new file and name it Component-changes.json and fill it with {} again.

    Refresh your app to check the errors gone from console hopefully!

    Created files in WEBIDE

    For some reasons we don't see these error messages in Fiori Launchpad.