Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot read property 'map' of undefined" from @ui5\builder\lib\processors\versionInfoGenerator.js #486

Closed
DerGuteWolf opened this issue Jan 27, 2021 · 5 comments
Labels
bug Something isn't working module/ui5-builder Related to the UI5 Builder module

Comments

@DerGuteWolf
Copy link

During a build we get the error "Cannot read property 'map' of undefined" and the build stops

Expected Behavior

Build finished through all tasks

Current Behavior

Build stops during task generateVersionInfo

Steps to Reproduce the Issue

Build of Fiori Elements application with dependencies

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 2.9.0
  • UI5 Builder Version v2.7.0 - 2021-01-26

Log Output / Stack Trace

info builder:builder application flatconfig 🔨 (10/15) Running task generateVersionInfo...
ERR! builder:builder Build failed in 4.01 s
info builder:builder Executing cleanup tasks...

⚠️ Process Failed With Error

Error Message:
Cannot read property 'map' of undefined

Stack Trace:
TypeError: Cannot read property 'map' of undefined
at processLibraryInfo (C:\neo-schedule\schedule-config\flatconfig\node_modules@ui5\cli\node_modules@ui5\builder\lib\processors\versionInfoGenerator.js:306:31)
at async Promise.all (index 0)
at async module.exports (C:\neo-schedule\schedule-config\flatconfig\node_modules@ui5\cli\node_modules@ui5\builder\lib\processors\versionInfoGenerator.js:394:22)
at async Object.module.exports [as task] (C:\neo-schedule\schedule-config\flatconfig\node_modules@ui5\cli\node_modules@ui5\builder\lib\tasks\generateVersionInfo.js:41:32)
at async Object.build (C:\neo-schedule\schedule-config\flatconfig\node_modules@ui5\cli\node_modules@ui5\builder\lib\builder\builder.js:395:4)
at async Object.handleBuild [as handler] (C:\neo-schedule\schedule-config\flatconfig\node_modules@ui5\cli\lib\cli\commands\build.js:101:2)

@DerGuteWolf DerGuteWolf added bug Something isn't working needs triage Needs to be investigated and confirmed as a valid issue that is not a duplicate labels Jan 27, 2021
@codeworrior codeworrior added module/ui5-builder Related to the UI5 Builder module and removed needs triage Needs to be investigated and confirmed as a valid issue that is not a duplicate labels Jan 27, 2021
@DerGuteWolf
Copy link
Author

Fix in SAP/ui5-builder#576

@codeworrior
Copy link
Member

codeworrior commented Jan 27, 2021

Happens when the sap.app section of a manifest does not contain an embeds property (array).

Indeed needs to be fixed.

As a workaround, either downgrade to an older version of the cli or temp. add an empty "sap.app"/"embeds" array to your library manifest.

[Update] ...or wait for us to review and merge your PR - sorry, my initial reply overlapped with your PR creation :-(

@DerGuteWolf
Copy link
Author

Hi @codeworrior ,
I waited until all checks of the PR were green before mentioning it here, thus the delay...
Thanks for the quick feedback.
Looking forward to the review.
I am a bit unsure if this should be better fixed at the source (ie in processManifest) or at the usage; in my PR I have done the latter since this limits impact on other parts which might also use embeds.

@codeworrior
Copy link
Member

Mhmm, for the libInfo.embeddedManifests, the fallback is in the same place, so I would be fine with your change.

@RandomByte
Copy link
Member

Thanks for reporting and creating the Pull Request!

Your fix has been released with @ui5/cli v2.9.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module/ui5-builder Related to the UI5 Builder module
Projects
None yet
Development

No branches or pull requests

3 participants