WebSocket is not defined
patrickianco opened this issue · 1 comments
patrickianco commented
stevkan commented
@patrickianco, for Direct Line to function in a Node environment, you need to install these two packages into your project and include them at the top of the file you are calling Direct Line in. If you do not, then you will get the error you are receiving. For reference, this requirement is listed in the docs under 'step 2', here.
global.XMLHttpRequest = require('xhr2');
global.WebSocket = require('ws');
As this should solve the issue, I am going to close this as resolved. If the issue persists, please feel free to reopen.