I was setting up a webpack.config for a project, and I got some errors. After doing some research and looking in the sources, I came to the conclusion that it's not guaranteed that FragmentDefinition or View are always in the "core:" or "mvc:" namespace. Even in the official libraries this is not always the case. See: RuleUpdate.fragment
This causes an error:
WARNING in ./node_modules/@openui5/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/view/ContentDetails.view.xml
Module build failed (from ./node_modules/openui5-xml-loader/dist/index.js):
TypeError: Cannot read property '$' of undefined
at [...]\node_modules\openui5-xml-loader\dist\index.js:56:31
at Parser.<anonymous> ([...]\node_modules\xml2js\lib\parser.js:303:18)
at Parser.emit (events.js:182:13)
at SAXParser.onclosetag ( [...]\node_modules\xml2js\lib\parser.js:261:26)
at emit ( [...]\node_modules\sax\lib\sax.js:624:35)
at emitNode ( [...]\node_modules\sax\lib\sax.js:629:5)
at closeTag ( [...]\node_modules\sax\lib\sax.js:889:7)
at SAXParser.write ( [...]\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString ( [...]\node_modules\xml2js\lib\parser.js:322:31)
at Parser.parseString ( [...]\node_modules\xml2js\lib\parser.js:5:59)
at exports.parseString ( [...]\node_modules\xml2js\lib\parser.js:354:19)
at Object.module.exports ( [...]\node_modules\openui5-xml-loader\dist\index.js:47:27)
@ . openui5 resources
@ ./node_modules/@openui5/sap.ui.core/src/sap/ui/core/Component.js
@ ./node_modules/@openui5/sap.ui.core/src/sap/ui/core/ComponentContainer.js
@ ./src/index.js
I was setting up a webpack.config for a project, and I got some errors. After doing some research and looking in the sources, I came to the conclusion that it's not guaranteed that FragmentDefinition or View are always in the "core:" or "mvc:" namespace. Even in the official libraries this is not always the case. See: RuleUpdate.fragment
This causes an error:
https://github.com/cevou/openui5-webpack/blob/34a64c703674565a47ae6d54d29bc1463d2bff42/packages/openui5-xml-loader/src/index.js#L46
I am using Yarn:
and
Thank you.