-
Notifications
You must be signed in to change notification settings - Fork 23
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
[FIX] Fix errors thrown from template analyzer #322
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When processing XML tags with no attributes, getAttributeNS throws Errors like this: ``` (node:9995) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object at Function.values (<anonymous>) at getAttributeNS (/home/i035043/src/portal-ui/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/lbt/analyzer/XMLTemplateAnalyzer.js:59:22) at XMLTemplateAnalyzer._analyzeCoreRequire (/home/i035043/src/portal-ui/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/lbt/analyzer/XMLTemplateAnalyzer.js:306:23) at XMLTemplateAnalyzer._analyzeNode (/home/i035043/src/portal-ui/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/lbt/analyzer/XMLTemplateAnalyzer.js:226:10) at node.$$.forEach (/home/i035043/src/portal-ui/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/lbt/analyzer/XMLTemplateAnalyzer.js:301:37) at Array.forEach (<anonymous>) at XMLTemplateAnalyzer._analyzeChildren (/home/i035043/src/portal-ui/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/lbt/analyzer/XMLTemplateAnalyzer.js:301:12) at XMLTemplateAnalyzer._analyzeNode (/home/i035043/src/portal-ui/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/lbt/analyzer/XMLTemplateAnalyzer.js:293:8) at node.$$.forEach (/home/i035043/src/portal-ui/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/lbt/analyzer/XMLTemplateAnalyzer.js:301:37) at Array.forEach (<anonymous>) (node:9995) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 44) ``` This is caused by `node.$` not existing in `getAttributeNS` function, and Object.values complaining about being called with `undefined` as parameter. Fixed by replacing undefined with an empty array.
matushorvath
changed the title
Fix errors thrown when analyzing templates
[FIX] Fix errors thrown from template analyzer
Sep 3, 2019
Facing similar issues in my build, hope this gets merged soon 😇. |
Thanks @matushorvath 👍 |
matz3
approved these changes
Sep 4, 2019
@martinxxd you could just switch back to UI5 CLI v1.7.0 until a patch is released. |
Released with @ui5/builder v1.5.1 / @ui5/cli v1.8.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When processing XML tags with no attributes, getAttributeNS throws Errors like this:
This is caused by
node.$
not existing ingetAttributeNS
function, and Object.values complaining about being called withundefined
as parameter. Fixed by replacing undefined with an empty array.Thank you for your contribution! 🙌
To get it merged faster, kindly review the checklist below:
Pull Request Checklist