未捕获的TypeError:WebSocketClient不是构造函数

时间:2018-11-04 08:17:58

标签: javascript websocket browserify

我已经使用browserify导出了websocket,

Sub INSERT_NEW_ROWS()
Dim rs As Worksheet
For Each rs In ThisWorkbook.Worksheets
   If rs.Name <> "3110" And rs.Name <> "Data" And rs.Name <> "Wholesale" And rs.Name 
<> "Retail" And rs.Name <> "Pivot 1" And rs.Name <> "Pivot 2" And rs.Name <> "Pivot 
3" And rs.Name <> "Pivot 4" And rs.Name <> "Pivot 5" And rs.Name <> "Pivot 6" And 
rs.Name <> "Pivot 7" And rs.Name <> "Pivot 8" And rs.Name <> "Pivot 9" And rs.Name <> 
"Pivot 10" And rs.Name <> "Pivot 11" Then

' LastRow in column A
LastRowa = rs.Cells(rs.Rows.Count, "A").End(xlUp).Row
' LastRow in column B
LastRowb = rs.Cells(rs.Rows.Count, "B").End(xlUp).Row    

'Copy paste the last row, based on what's in column A in the next empty row

rs.Cells(LastRowa, 2).EntireRow.Copy
rs.Cells(LastRowa + 1, 1).PasteSpecial xlPasteFormulas

'Change the formula of the last cell in column  B into a value
rs.Cells(LastRowb, 2).Copy
rs.Cells(LastRowb + 1, 2).PasteSpecial xlPasteFormulas
rs.Cells(LastRowb, 2).Value = rs.Cells(LastRowb, 2).Value
End If
Next rs

End Sub

然后我尝试在浏览器中运行以下代码

 browserify -r websocket > bundle.js

但是我在浏览器控制台中遇到以下错误

<script src="bundle.js"></script>
var WebSocketClient = require('websocket').client;
var client = new WebSocketClient();

有人可以指导我我在做什么错吗?

0 个答案:

没有答案