SAP/ui5-tooling

Build fails with "Could not create Module: Parameter 'modulePath' must contain an absolute path"

NikoletaBogdanova opened this issue · 5 comments

Jenkins build of UI5 app began failing since releasing ui5-project 3.0.3 version on 01.03.2023 on step
ui5 build --config=uimodule/ui5.yaml --clean-dest --dest uimodule/dist --include-task=generateManifestBundle --clean-dest --verbose"

I suppose this change is causing the error SAP/ui5-project@f36b50e

[2023-03-02T14:59:10.555Z] verb graph:helpers:ui5Framework SAPUI5 dependencies sap.ui.core, sap.m, sap.ui.layout, sap.f resolved in 5.08 ms
[2023-03-02T14:59:10.555Z] verb graph:helpers:ui5Framework Creating project for library sap.ui.core...
[2023-03-02T14:59:10.555Z] verb graph:helpers:ui5Framework Creating project for library sap.m...
[2023-03-02T14:59:10.555Z] verb graph:helpers:ui5Framework Creating project for library sap.ui.layout...
[2023-03-02T14:59:10.555Z] verb graph:helpers:ui5Framework Creating project for library sap.ui.unified...
[2023-03-02T14:59:10.555Z] verb graph:helpers:ui5Framework Creating project for library sap.f...
[2023-03-02T14:59:10.555Z] ⚠️  Process Failed With Error
[2023-03-02T14:59:10.555Z] 
[2023-03-02T14:59:10.555Z] Error Message:
[2023-03-02T14:59:10.555Z] Could not create Module: Parameter 'modulePath' must contain an absolute path
[2023-03-02T14:59:10.555Z] 
[2023-03-02T14:59:10.555Z] Stack Trace:
[2023-03-02T14:59:10.555Z] Error: Could not create Module: Parameter 'modulePath' must contain an absolute path
[2023-03-02T14:59:10.555Z]     at new Module (file:///home/jenkins/tech-docs-ui/tech-docs-ui/node_modules/@ui5/cli/node_modules/@ui5/project/lib/graph/Module.js:55:10)
[2023-03-02T14:59:10.555Z]     at ProjectProcessor._addProjectToGraph (file:///home/jenkins/tech-docs-ui/tech-docs-ui/node_modules/@ui5/cli/node_modules/@ui5/project/lib/graph/helpers/ui5Framework.js:68:16)
[2023-03-02T14:59:10.556Z] 
[2023-03-02T14:59:10.556Z] If you think this is an issue of the UI5 Tooling, you might report it using the following URL: https://github.com/SAP/ui5-tooling/issues/new/choose
[2023-03-02T14:59:10.556Z] ERROR: "build:uimodule" exited with 1.

On my local machine the build is just fine. The -verbose option does not print which module is not defined with absolute path

part of ui5.yaml

specVersion: "2.2"
metadata:
  name: techdocs_uimodule
type: application
resources:
  configuration:
    paths:
      webapp: uimodule/webapp
framework:
  name: SAPUI5
  version: 1.108.5
  libraries:
    - name: sap.ui.core
    - name: sap.m
    - name: sap.ui.layout
    - name: sap.f
    - name: themelib_sap_fiori_3

dev dependencies in package.json

"devDependencies": {
    "@ui5/cli": "3.0.2",
    "csstree-validator": "3.0.0",
    "eslint": "8.34.0",
    "karma": "6.4.1",
    "karma-chrome-launcher": "3.1.1",
    "karma-coverage": "2.2.0",
    "karma-ui5": "3.0.0",
    "npm-run-all": "4.1.5",
    "prettier": "2.8.4",
    "shx": "0.3.4",
    "ui5-middleware-livereload": "0.7.2",
    "ui5-task-cachebuster-indexing": "1.0.2"
  },

What should we do to fix the Jenkins build?

matz3 commented

First of all, please commit the lockfile, e.g. package-lock.json (see https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json) to your repository in order to have reproducible builds in CI.

The mentioned change was already part of the initial 3.0.0 release, so I wonder whether it is indeed the root cause.

With the information provided I'm unable to reproduce the mentioned issue.
Please either provide a small, public example project to demonstrate the issue, or as you seem to be an employee, send me the project details via e-mail.

Hi, I've committed the package-lock.json file in the repo but the result is the same. On my local machine (Mac) the build passes successfully and it fails on the Jenkins (Alpine image). We reverted the version of "@ui5/cli": "2.14.17" in the master not to block the work. I will send you an email with the details.

Hi @NikoletaBogdanova ,

We've prepared a fix for the issue: SAP/ui5-project#588
Please track the progress in the Pull Request

Cheers

Reopening the issue, because we haven't made a patch release yet

Hi @NikoletaBogdanova ,

You could find the fix in ui5-project@3.04: SAP/ui5-project@2d174fc

Cheers