pfefferf / ui5-nwabap-deployer

UI5 Deployer for SAP NetWeaver ABAP
Apache License 2.0
55 stars 18 forks source link

ui5 serve doesn't work for ui5-task-nwabap-deployer #22

Closed sanjoy0308 closed 4 years ago

sanjoy0308 commented 4 years ago

"devDependencies": { "ui5-task-nwabap-deployer": "*" }, "ui5": { "dependencies": [ "ui5-task-nwabap-deployer" ] }

If I remove this part from package.json and run npm install, after that ui5 serve works.

pfefferf commented 4 years ago

What error you get? What UI5 tooling version you are using? How does your configuration looks like? ...

sanjoy0308 commented 4 years ago

Hi Florian,

The sap library resources are misaligned if I keep "ui5-task-nwabap-deployer" and see this error in the browser console. GET http://localhost:8080/resources/sap-ui-core.js net::ERR_ABORTED 404 (Not Found)

ui5 tooling version is latest ("2.4.0") { "name": "xxxxxxx", "version": "1.0.0", "description": "xxxxxxx", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "xxxxxxx" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "@openui5/sap.f": "*", "@openui5/sap.m": "*", "@openui5/sap.tnt": "*", "@openui5/sap.ui.core": "*", "@openui5/sap.ui.layout": "*", "@openui5/sap.ui.table": "*", "@openui5/sap.ui.testrecorder": "*", "@openui5/sap.ui.unified": "*", "@openui5/sap.uxap": "*", "@openui5/themelib_sap_fiori_3": "*", "@sapui5/sap.ui.comp": "*", "@ui5/cli": "*", "@ui5/server": "*", "@ui5/uiveri5": "*" }, "devDependencies": { "ui5-task-nwabap-deployer": "*" }, "ui5": { "dependencies": [ "ui5-task-nwabap-deployer" ] } }

pfefferf commented 4 years ago

Can you show your ui5.yaml file too please.

sanjoy0308 commented 4 years ago
specVersion: '2.1'
metadata:
  name: xxxxx
type: application
framework:
  name: SAPUI5
  version: 1.80.1
resources:
  configuration:
    propertiesFileSourceEncoding: UTF-8
    paths:
      webapp: /webapp
builder:
  cachebuster:
    signatureType: hash
  customTasks:
  - name: ui5-task-nwabap-deployer
    afterTask: generateVersionInfo
    configuration: 
      resources:
        pattern: "**/*.*"
      connection:
        server: https://xxxxxxxxxxxxx:8300  
      authentication:
        user: XXXXX
        password: XXXXXXXXXXXXXXXXXXXXXX
      ui5:
        language: EN
        package: ZDEV
        bspContainer: ZXXXXXXXXX
        bspContainerText: UI5 Upload
        transportNo: XXXX000000
        calculateApplicationIndex: true   
pfefferf commented 4 years ago

I tested an example with the same parameters than you described without having the issue you described. And I do not really see how this builder-task should have an effect on the ui5 serve action.

sanjoy0308 commented 4 years ago

Hi Florian,

Can I show you the issue?

I just remove "devDependencies": { "ui5-task-nwabap-deployer": "*" }, "ui5": { "dependencies": [ "ui5-task-nwabap-deployer" ] } from package.json, and it works.

pfefferf commented 4 years ago

I understood your description, but I cannot reproduce the issue. Can you share your whole repo?

sanjoy0308 commented 4 years ago

I will share my repo.

sanjoy0308 commented 4 years ago

I have added you in the sample as a collaborator to ui5-task-nwabap-deployer

pfefferf commented 4 years ago

Thanks for sharing your repo.

Actually the issue you describe is not related to the ui5-task-nwabap-deployer task. The same issue can be reproduced by just having an empty UI5 dependency array in the package.json:

"ui5": { "dependencies" : [] }

Without this empty array (or an array filled with any dependency), the serve command analyzes the "standard" dependencies of your package.json and finds the dependencies to the OpenUI5 modules. With that, the OpenUI5 resources can be served locally (but not sure if that is a feature ;-)). Having a UI5 dependency defined, the OpenUI5 resources are not found anymore and you get the error you described.

In general, if you want to serve the UI5 resources locally, you should use the framework configuration option of the UI5 tooling framework.

Hope that helps.