You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue while attempting to use the lightstreamer-client JavaScript library in Python via JSPyBridge. In JavaScript, the library can be imported and used as follows:
To replicate this functionality in Python, I tried the following code using JSPyBridge:
importjavascriptasjsls=js.require("lightstreamer-client")
lsc=ls.LightstreamerClient("push.example.com", "DEFAULT") # This won't worklsc=ls.LightstreamerClient.new("push.example.com", "DEFAULT") # This won't work as well
However, both attempts result in errors.
The first attempt ls.LightstreamerClient("push.example.com", "DEFAULT") produces the following error:
☕ JavaScript Error Call to 'LightstreamerClient' failed:
> lsc = ls.LightstreamerClient("push.example.com", "DEFAULT")
at <module> (.../testjs.py:4)
>
... across the bridge ...
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
at Readable.push (node:internal/streams/readable:390:5)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at addChunk (node:internal/streams/readable:559:12)
at Socket.emit (node:events:518:28)
at Socket.<anonymous> (/opt/homebrew/lib/python3.11/site-packages/javascript/js/bridge.js:292:18)
at Bridge.onMessage (/opt/homebrew/lib/python3.11/site-packages/javascript/js/bridge.js:231:25)
at Bridge.call (/opt/homebrew/lib/python3.11/site-packages/javascript/js/bridge.js:136:42)
at Object.z (/opt/homebrew/lib/python3.11/site-packages/javascript/js/node_modules/lightstreamer-client/lightstreamer.js:313:375)
> define("LightstreamerClient","Helpers Global Executor lscC lscE lscD lscAP lscAI lscAO lscAc Inheritance Setter EventDispatcher lscAe EnvironmentStatus IllegalArgumentException Environment LoggerManager IllegalStateException ASSERT lsco lsck ls_sbc BrowserDetection lscAK".split(""),function(d,f,b,a,c,g,e,p,k,h,l,m,r,n,t,u,q,x,v,A,C,w,H,D,L){function z(b,e){this.C=z;this._callSuperConstructor(z);
🌉 TypeError: this._callSuperConstructor is not a function
The second attempt ls.LightstreamerClient.new("push.example.com", "DEFAULT") leads to this error:
☕ JavaScript Error Call to '' failed:
> lsc = ls.LightstreamerClient.new("push.example.com", "DEFAULT")
at <module> (.../testjs.py:5)
>
... across the bridge ...
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
at Readable.push (node:internal/streams/readable:390:5)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at addChunk (node:internal/streams/readable:559:12)
at Socket.emit (node:events:518:28)
at Socket.<anonymous> (/opt/homebrew/lib/python3.11/site-packages/javascript/js/bridge.js:292:18)
at Bridge.onMessage (/opt/homebrew/lib/python3.11/site-packages/javascript/js/bridge.js:231:25)
at Bridge.init (/opt/homebrew/lib/python3.11/site-packages/javascript/js/bridge.js:128:68)
TypeError: this.m[ffid] is not a constructor
> ^
🌉 TypeError: this.m[ffid] is not a constructor
It appears that the bridge is unable to handle the instantiation of LightstreamerClient. Could you please provide guidance or any suggestions on how to correctly instantiate this class in Python?
Thanks.
The text was updated successfully, but these errors were encountered:
arvindavoudi
changed the title
Unable to instantiate of LightstreamerClient using .new
Unable to instantiate LightstreamerClient using .newJan 23, 2025
Hi,
I encountered an issue while attempting to use the
lightstreamer-client
JavaScript library in Python via JSPyBridge. In JavaScript, the library can be imported and used as follows:To replicate this functionality in Python, I tried the following code using JSPyBridge:
However, both attempts result in errors.
ls.LightstreamerClient("push.example.com", "DEFAULT")
produces the following error:ls.LightstreamerClient.new("push.example.com", "DEFAULT")
leads to this error:It appears that the bridge is unable to handle the instantiation of LightstreamerClient. Could you please provide guidance or any suggestions on how to correctly instantiate this class in Python?
Thanks.
The text was updated successfully, but these errors were encountered: