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

ERR! lbt:analyzer:JSModuleAnalyzer Unhandled AST node type ChainExpression Node #575

Closed
pubmikeb opened this issue Oct 23, 2021 · 8 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@pubmikeb
Copy link

pubmikeb commented Oct 23, 2021

I'm running the UI5 Tolling process via npx:

import {execSync} from "child_process";

execSync("npx --yes @ui5/cli build --config ./devops/ui5.rel.yaml --exclude-task=createDebugFiles --dest ./src/webapp/rel/production --clean-dest true", {stdio: "inherit"});

In the console I get the following multiple errors:

info builder:builder application com.myApp 🔨 (5/7) Running task generateComponentPreload...
ERR! lbt:analyzer:JSModuleAnalyzer Unhandled AST node type ChainExpression Node {
ERR! lbt:analyzer:JSModuleAnalyzer   type: 'ChainExpression',
ERR! lbt:analyzer:JSModuleAnalyzer   start: 1399,
ERR! lbt:analyzer:JSModuleAnalyzer   end: 1429,
ERR! lbt:analyzer:JSModuleAnalyzer   expression: Node {
ERR! lbt:analyzer:JSModuleAnalyzer     type: 'MemberExpression',
ERR! lbt:analyzer:JSModuleAnalyzer     start: 1399,
ERR! lbt:analyzer:JSModuleAnalyzer     end: 1429,
ERR! lbt:analyzer:JSModuleAnalyzer     object: Node {
ERR! lbt:analyzer:JSModuleAnalyzer       type: 'Identifier',
ERR! lbt:analyzer:JSModuleAnalyzer       start: 1399,
ERR! lbt:analyzer:JSModuleAnalyzer       end: 1416,
ERR! lbt:analyzer:JSModuleAnalyzer       name: 'uploadDestination'
ERR! lbt:analyzer:JSModuleAnalyzer     },
ERR! lbt:analyzer:JSModuleAnalyzer     property: Node {
ERR! lbt:analyzer:JSModuleAnalyzer       type: 'Identifier',
ERR! lbt:analyzer:JSModuleAnalyzer       start: 1418,
ERR! lbt:analyzer:JSModuleAnalyzer       end: 1429,
ERR! lbt:analyzer:JSModuleAnalyzer       name: 'isSucceeded'
ERR! lbt:analyzer:JSModuleAnalyzer     },
ERR! lbt:analyzer:JSModuleAnalyzer     computed: false,
ERR! lbt:analyzer:JSModuleAnalyzer     optional: true
ERR! lbt:analyzer:JSModuleAnalyzer   }
ERR! lbt:analyzer:JSModuleAnalyzer }
ERR! lbt:resources:ResourcePool failed to analyze webapp/controller/document/DocumentEdit.controller.js: Error: Unhandled AST node type ChainExpression
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:506:12)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:498:7)
ERR! lbt:resources:ResourcePool     at C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\builder\lib\
lbt\analyzer\JSModuleAnalyzer.js:370:29
ERR! lbt:resources:ResourcePool     at Array.forEach (<anonymous>)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:370:10)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\builder\lib\
lbt\analyzer\JSModuleAnalyzer.js:370:29
ERR! lbt:resources:ResourcePool     at Array.forEach (<anonymous>)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:370:10)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at JSModuleAnalyzer.analyze (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node
_modules\@ui5\builder\lib\lbt\analyzer\JSModuleAnalyzer.js:290:3)
ERR! lbt:resources:ResourcePool     at determineDependencyInfo (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_
modules\@ui5\builder\lib\lbt\resources\ResourcePool.js:76:16)
ERR! lbt:resources:ResourcePool     at processTicksAndRejections (node:internal/process/task_queues:96:5)
ERR! lbt:resources:ResourcePool     at async Promise.all (index 34)
ERR! lbt:resources:ResourcePool     at async BundleBuilder._createBundle (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5
\cli\node_modules\@ui5\builder\lib\lbt\bundle\Builder.js:141:26)
ERR! lbt:analyzer:JSModuleAnalyzer Unhandled AST node type ChainExpression Node {
ERR! lbt:analyzer:JSModuleAnalyzer   type: 'ChainExpression',
ERR! lbt:analyzer:JSModuleAnalyzer   start: 9711,
ERR! lbt:analyzer:JSModuleAnalyzer   end: 9731,
ERR! lbt:analyzer:JSModuleAnalyzer   expression: Node {
ERR! lbt:analyzer:JSModuleAnalyzer     type: 'MemberExpression',
ERR! lbt:analyzer:JSModuleAnalyzer     start: 9711,
ERR! lbt:analyzer:JSModuleAnalyzer     end: 9731,
ERR! lbt:analyzer:JSModuleAnalyzer     object: Node {
ERR! lbt:analyzer:JSModuleAnalyzer       type: 'MemberExpression',
ERR! lbt:analyzer:JSModuleAnalyzer       start: 9711,
ERR! lbt:analyzer:JSModuleAnalyzer       end: 9725,
ERR! lbt:analyzer:JSModuleAnalyzer       object: [Node],
ERR! lbt:analyzer:JSModuleAnalyzer       property: [Node],
ERR! lbt:analyzer:JSModuleAnalyzer       computed: false,
ERR! lbt:analyzer:JSModuleAnalyzer       optional: true
ERR! lbt:analyzer:JSModuleAnalyzer     },
ERR! lbt:analyzer:JSModuleAnalyzer     property: Node { type: 'Identifier', start: 9727, end: 9731, name: 'link' },
ERR! lbt:analyzer:JSModuleAnalyzer     computed: false,
ERR! lbt:analyzer:JSModuleAnalyzer     optional: true
ERR! lbt:analyzer:JSModuleAnalyzer   }
ERR! lbt:analyzer:JSModuleAnalyzer }
ERR! lbt:resources:ResourcePool failed to analyze webapp/controller/BaseController.js: Error: Unhandled AST node type ChainExpression
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:506:12)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\builder\lib\
lbt\analyzer\JSModuleAnalyzer.js:370:29
ERR! lbt:resources:ResourcePool     at Array.forEach (<anonymous>)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:370:10)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:498:7)
ERR! lbt:resources:ResourcePool     at C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\builder\lib\
lbt\analyzer\JSModuleAnalyzer.js:370:29
ERR! lbt:resources:ResourcePool     at Array.forEach (<anonymous>)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:370:10)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at visit (C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\build
er\lib\lbt\analyzer\JSModuleAnalyzer.js:510:6)
ERR! lbt:resources:ResourcePool     at C:\Users\User\AppData\Local\npm-cache\_npx\b3b0151a15b6054b\node_modules\@ui5\cli\node_modules\@ui5\builder\lib\
lbt\analyzer\JSModuleAnalyzer.js:370:29
ERR! lbt:resources:ResourcePool     at Array.forEach (<anonymous>)

Context

  • UI5 Module Version: 2.14.0 (the latest version available via npx)
  • Node.js Version: 17.0.1 / 18.0.0
  • npm Version: 8.1.1
  • OS/Platform: Windows 10

Notes

There was no such error on 2.13.0

@pubmikeb pubmikeb added bug Something isn't working needs triage Needs to be investigated and confirmed as a valid issue that is not a duplicate labels Oct 23, 2021
@codeworrior codeworrior added duplicate This issue or pull request already exists and removed needs triage Needs to be investigated and confirmed as a valid issue that is not a duplicate labels Oct 23, 2021
@codeworrior
Copy link
Member

Please read SAP/ui5-builder#615 (comment) for an explanation why we plan to fix this only with the next major version of the tooling.

@pubmikeb
Copy link
Author

Please read SAP/ui5-builder#615 (comment) for an explanation why we plan to fix this only with the next major version of the tooling.

Thanks a lot for the reference.
Is there any roadmap when the version 3.0 will be released?

@RandomByte
Copy link
Member

Closing as duplicate.

There is a roadmap for 3.0 but no timeline. Subscribe to #506 to get updates

@RandomByte
Copy link
Member

Actually let's keep this issue open as reference for this requirement.

@RandomByte RandomByte reopened this Oct 26, 2021
@RandomByte RandomByte added enhancement New feature or request and removed bug Something isn't working labels Oct 26, 2021
@Jpsy
Copy link

Jpsy commented Feb 13, 2023

For others comming here in search for a solution:

It seems like the build process currently does not support optional chaining (AKA null conditional operator):

var value = ObjectName?.PropertyName;

Try to replace the ?. operator, i.e. like so:

var value = ObjectName ? ObjectName.PropertyName : null;

@codeworrior
Copy link
Member

codeworrior commented Feb 13, 2023

...or use ui5-tooling 3.0 ;-)

@matz3
Copy link
Member

matz3 commented Feb 13, 2023

Closing as resolved with v3.0.0

@matz3 matz3 closed this as completed Feb 13, 2023
@Jpsy
Copy link

Jpsy commented Feb 14, 2023

...or use ui5-tooling 3.0 ;-)

Great news!
Just tested: v3 indeed solves the problem.

To migrate:
npm i --save-dev @ui5/cli@latest
...and if you want, remove the block "ui5" (including ui5.dependencies) from package.json. It is not needed anymore.

Details see:
https://sap.github.io/ui5-tooling/v3/updates/migrate-v3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants