Dear ionic community,
I write this post because I have this problem a lot of times and I don’t know what cause these. I am running “ionic serve” for debug my project whithout any compiled error, but with this warning:
_UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'content' of null_
when my project is open in my webbrowser the page is blank and the console output is:
Failed to load resource: the server responded with a status of 404 (Not Found)
2http://localhost:8100/build/main.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8100/build/main.css Failed to load resource: the server responded with a status of 404 (Not Found)
The point is in this function:
loadChannels(data){
this.appParam.sqlChannels =[];
data.forEach(element => {
this.appParam.sqlChannels.push(new Channel(element.ID, element.ChanName, "localhost"));
});
}
If i comment the line “this.appParam.sqlChannels.push(new Channel(element.ID, element.ChanName, "localhost"));
” it is solve.
This happen to me other times with variables declaration such as “new [class]()
” or with the declaration of a simple variable with "var a =1"
.
Could you tell me why is happening that??
thanks in advance