openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Wrong tooling configuration and missing dependencies in UI5 Walkthrough tutorial samples

Open svbender opened this issue 3 years ago • 4 comments

Hello,

This issue was taken from: https://github.com/SAP/ui5-tooling/issues/530

The dependencies and ui5-tooling configuration in the downloaded samples from the UI5 Walkthrough tutorial are not correct: https://sapui5.hana.ondemand.com/#/entity/sap.m.tutorial.walkthrough/sample/sap.m.tutorial.walkthrough.08 https://sapui5.hana.ondemand.com/#/entity/sap.m.tutorial.walkthrough/sample/sap.m.tutorial.walkthrough.10 Please also check the other steps, it is the same issue for all available steps.

Steps to reproduce:

  1. Download one of the examples (e.g. step 8 or 10) and extract it.
  2. Navigate into the folder and run npm install to install the dependencies.
  3. Run npm start to run ui5 serve.

The following error occurs:

Could not find required manifest.json for project sap.m.tutorial.walkthrough.08: ENOENT: no such file or directory, open '/someAbsolutePath/sap.m.tutorial.walkthrough.08/manifest.json'

If you fix the path in the ui5.yaml and a manifest.json file is available the dependencies to sap.ui.core and sap.m are still missing. You can check this in the browser when loading the served app.

Proposal to fix the issue:

  1. The ui5-tooling requires a manifest.json file which is only introduced since step 10 of the walkthrough. A possible fix would be adding a manifest.json with the minimum requirements as a dummy in the webapp folder:
{
    "sap.app": {
    "id":"sap.ui.demo.walkthrough",
    "type":"application"
  }
}
  1. The path to the webapp is wrong and needs to be changed in the ui5.yaml:
webapp:"./webapp/"

This webapp path is the default one which means you can also remove the resources: configuration: paths: ... part.

  1. The dependencies in the package.json aren't complete. The sap.m and sap.ui.core dependencies are missing. It should look something like this:
"dependencies":{
"@openui5/sap.m":"^1",
"@openui5/sap.ui.core":"^1",
"@openui5/themelib_sap_fiori_3":"^1"
},

(Thanks @RandomByte) Please note that we also don't recommend declaring OpenUI5 dependencies in package.json anymore. See https://sap.github.io/ui5-tooling/pages/OpenUI5/

Thanks and best regards Sven

svbender avatar Jul 02 '21 09:07 svbender

The dependencies in the package.json aren't complete. The sap.m and sap.ui.core dependencies are missing.

Note that we also don't recommend declaring OpenUI5 dependencies in package.json anymore. See https://sap.github.io/ui5-tooling/pages/OpenUI5/

RandomByte avatar Jul 02 '21 14:07 RandomByte

Hello @svbender,

Thank you for sharing this finding. I've created an internal incident 2180268147. The status of the issue will be updated here in GitHub.

Regards, Nikolay

ndeshev avatar Jul 06 '21 05:07 ndeshev

This issue will be covered in backlog item BGSOFUIPIRIN-5329.

flovogt avatar Mar 02 '22 12:03 flovogt

Thanks for sharing all of this, I was stuck with getting a sapui5 minimal app running. I followed along here and you helped me a lot. So if anybody else is stuck, maybe the commit https://github.com/informatom/sapui5-demo/commit/8c72bb43978ba86d2700a0004245f47498a7386c in my repo can help you get running in SAP Business Application Studio. npm install and ui5 serve should be enough to get you up and running after cloning that particular commit.

haslinger avatar Apr 19 '22 07:04 haslinger

Fixed with ad6a5b7536355a5bfadcdb4caed470b9c0570a76 and available with UI5 1.119.0

flovogt avatar Oct 02 '23 11:10 flovogt

The fix took more than 2 years, I face the same issue in 2023. I installed ui5 today, and still face that

bora89 avatar Oct 02 '23 18:10 bora89

@bora89 Tutorial setup is working fine now.

I guess you're talking about the ui5 init command, requiring a manifest.json. If so, https://github.com/SAP/ui5-tooling/issues/306 should be the place for further updates.

flovogt avatar Oct 04 '23 07:10 flovogt