Support Topics Documentation Slack YouTube Blog

Backendless Realtime updates not working

(Steven Salmon) #1

In my project realtime updates were working fine about a week ago. Gone back to the project today and they are no longer working. I created a gitrepo to demonstrate a similar technique to what was provided in the backendless angular blog post. I can see no reason to why these updates are not working? I continually get http requests made to https:// ** rt/lookup addresses which appear to be a fallback of some kind!

Appreciate any pointers.

Many thanks


(Vladimir Upirov) #2

Hi Steven
Looks like the problem is also with Angular build system,
the builder can not resolve “global” object when building a bundle for browsers that’s the reason why your app doesn’t work.

so, I found out two workarounds how to fix that:

the first, is to specify path to build for browser in tsconfig.json,

 "": [

just like you did it here: Backendless SDK + Angular results in compile error!

and the other one is to add a polyfill for “global” to polyfills.ts

(window as any).global = window;

like here:

I assume the last one is more better way

(Steven Salmon) #3

@vladimir-upirov this is extremely helpful and has solved the problem thank you. What puzzles me is that your example on your repo works perfectly fine without any changes you have mentioned. Any ideas on this one?

Thank you once again for your help.

(Vladimir Upirov) #4

I guess it’s because I didn’t use “–prod” flag for building

(Steven Salmon) #5

Its odd because both projects were running locally without the --prod. Your project worked without change, other than the app id etc. It’s a mystery.

(Vladimir Upirov) #6

yeah, but you added the next definitions for getting “ng build --prod” working, don’t you?

"paths": {
  "backendless": [
  "backendless-rt-client": [
  "backendless-request": [

(Steven Salmon) #7

Yes correct I just did this as a matter of course. This issue was being experienced without doing a prod build. I just simply run ng serve and experienced the problem locally.

(Vladimir Upirov) #8

yes, since you have re-defined paths to Backendless modules ng serve won’t work as before, because without that Angular gets an assembled Backendless JS-SDK for browser (from node_modules/backendless/dist/backendless.js) and it works, but it doesn’t when you run ng build --prod =)