Daniel Srp
Daniel Srp

Reputation: 383

angularjs possibly unhandled rejection could not find map

I start by saying that I already saw all the similar questions. I have an angularjs application which uses ng-map and ui-router. The problem is the one mentioned in the title. When this error is thrown the map ends up in the middle of the ocean.

I read that this could be a problem of ng-map so I raised the value of the timeout, but didn't solve the problem. I also read that could be a problem between ui-router and ng-map, but I don't know what to do about it. The real problem is that happens randomly, so I can not reproduce it. If I do hard refresh of the page after the problem occurs (the map goes in the middle of the ocean) the application work just fine.

There is anybody that has an idea of how I could solve this problem? A solution would be to reload the page from javascript when the error occurs, the problem is that I didn't find a way of intercepting this error, so that I can refresh the page. Thanks in advance.

Upvotes: 0

Views: 294

Answers (1)

Alexander
Alexander

Reputation: 3245

Some promise is throwing an error. Add a catch block and maybe that error will tell you more

getMapOrSomething() <-- Promise
.then(function (response) {})
.catch(function (error) {
  // debug error
});

Upvotes: 1

Related Questions