Cannot read property 'previousScope' of undefined

Cannot read property 'previousScope' of undefined


I have a problem with my application like in the picture below

When I check in ServiceCenter out errors are like the picture below

How to solve it?

Hi Imas.

Actually, I already got that error and wasn't able to fix it easily.

As a quick test, you can try to create a new application in Service Studio and move the modules to that new application, generating the native app again.

It worked for me, but I would really like to have some technical explanations about this by someone from Outsystems.



Hi Imas.

Did you manage to fix this issue? If so, please share what you did. 

The way I suggested, you tried it?



Hi Goncalo

I've tried the solution you gave, but it did not work.I tried to upgrade my module then I uploaded back in testflight and it worked on iphone.

Hi Imas.

What did you mean by upgrade the module? 

And did you got the same result for Android (if you use it as a target too)?

Hi Goncalo,

You can upgrade the module version as shown below

In android there is no problem. 

Hi Imas.

Ok, I didn't understand you were talking about the application version inside Lifetime.

However, the issue you reported seems to me to be actually a platform bug and I'll try to report it to the Outsystems team.

I'm having the same issue with my mobile app. I'm trying to implement the OneSignal notification plugin. As soon as implement the plugin, this error starts coming up. I'm trying to get it to work on Android.

I've tried moving to a new app, but the error persisted.

Hi guys,

I have the same issue but it only started to appear after add the OneSignal Plugin.

TypeError: Cannot read property 'previousScope' of undefined     at Object.exports.destroyScope (     at     at Object.execCb (     at b.check (     at b.enable (     at b.init (     at

The first page show correctly but when I click in some link show this error after load the page. Any Help?



Any updates on this issue. We also implemented OneSignal.


Still no good answer?

Hi Everyone

I have not used the OneSignal plugin, however I have seen that error in the past. The error comes up when a timer or some event of one screen is left active even though the screen has been navigated away from. We had the issue using javascript timeouts. 

The solution for us was to deactivate the timeout on the OnDestroy event of the screen (or the layout in our case). The plugin is probably leaving something loaded on the screen that is not being unloaded when navigating away.

Hope this helps!



Onesignal plugin not work on Browser/OutSystem App.

You have to generate build in order to test.

But for the sake of testing on browser, I have handled the error of it.

1- In Common->Layout Block -> Add onInitialize Event

2- onIntializeEvent -> Check whether the plugin is available for current platform or not & set the Flag.

3- Add If block in Design to add the oneSignal block or not.

This will handle the error & prevent from crash on browser / outsystem app

Ref below screens for more detail.