typeError: Cannot read property 'widget' of undefined


#1

getting type error when running ionic serve --lab in ionic2
Caught exception:
TypeError: Cannot read property ‘widget’ of undefined
at C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\lib\serve.js:410:30
at Parser. (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\lib\xml2js.js:488:18)
at emitOne (events.js:96:13)
at Parser.emit (events.js:188:7)
at Object.onerror (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\lib\xml2js.js:309:26)
at emit (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\node_modules\sax\lib\sax.js:640:35)
at error (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\node_modules\sax\lib\sax.js:669:5)
at strictFail (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\node_modules\sax\lib\sax.js:693:7)
at Object.write (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\node_modules\sax\lib\sax.js:1093:13)
at Parser.exports.Parser.Parser.parseString (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\lib\xml2js.js:503:31)

but when running ionic serve instead --lab works fine


#2

This error may be due to a syntax error in the main config.xml at the root of your project, possibly you broke the structure or inserted non-permitted characters such as “&”, “<” etc.


#3

This was indeed my problem. Thanks mate.


#4

If we add any comments in config.xml the above error is re-producible