Local cumulocity web app dev server is not sending realtime notification

Hi!

I’m developing a widget that shows a 2D line chart in a Cockpit application. To set the local enviroment up I run npm start:

> dac-cockpit@1.0.0 start
> c8ycli -p 8000 server -u https://dac-testing.cumulocity.com

Proxying requests to remote instance https://dac-testing.cumulocity.com

http://localhost:8000/apps/dac-cockpit/ 11 % - building - 9/10 modules


http://localhost:8000/apps/dac-cockpit/ 98 % - after emitting - angular-compiler



Hash: d52f23fcde3b8471d442
Version: webpack 4.46.0
Time: 46711ms
Built at: 05/03/2022 9:22:36 AM
chunk {app} app.js (app) 1.03 MiB <{bootstrap}> ={vendors~app}= ={vendors~app~branding}= [rendered]
chunk {bootstrap} bootstrap.js (bootstrap) 35.4 KiB >{app}< >{branding}< >{vendors~app}< >{vendors~app~branding}< >{vendors~branding}< [entry] [rendered]
chunk {branding} branding.js (branding) 2.06 MiB <{bootstrap}> ={vendors~app~branding}= ={vendors~branding}= [rendered]
chunk {vendors~app} vendors~app.js (vendors~app) 20.4 MiB <{bootstrap}> ={app}= ={vendors~app~branding}= [rendered] split chunk (cache group: vendors) (name: vendors~app)
chunk {vendors~app~branding} vendors~app~branding.js (vendors~app~branding) 11.3 KiB <{bootstrap}> ={app}= ={branding}= ={vendors~app}= ={vendors~branding}= [rendered] split chunk (cache group: vendors) (name: vendors~app~branding)
chunk {vendors~branding} vendors~branding.js (vendors~branding) 205 KiB <{bootstrap}> ={branding}= ={vendors~app~branding}= [rendered] split chunk (cache group: vendors) (name: vendors~branding)

http://localhost:8000/apps/dac-cockpit/ done - finished in 46 s - 692.508 ms

When I hit http://localhost:8000/apps/dac-cockpit/ the widget is not updated in real time (i.e. the line is not moving) and I get the following error in the console of dev tools:

client.umd.js?3927:948 WebSocket connection to 'ws://localhost:8000/notification/realtime' failed: Invalid frame header

I tried also on Firefox without any luck:

The connection to ws://localhost:8000/notification/realtime was interrupted while the page was loading.

This problem occurs only locally. When I deploy the application on my production tenant the widget is updated in real time.


Versions:

  • OS: Fedora 35
  • Node v16.3.0
  • Chrome 101.0.4951.41
  • Firefox 99.0.1

Hi,

there was an issue within the Cumulocity WebSDK (to be precise in the @c8y/cli package) that caused problems with websockets during local development.
The issue has been addressed in fix releases of the WebSDK above 10.10.0.25 and 10.11.0.13

Regards,
Tristan

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.