Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReconnectingWebSocket is not defined, Electron app #94

Open
ghost opened this issue Jan 29, 2018 · 3 comments
Open

ReconnectingWebSocket is not defined, Electron app #94

ghost opened this issue Jan 29, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 29, 2018

Hi,
I get an error while running an app in Electron.
This app is running normally in browsers (firefox, chrome, chromium v63.0.3239.132), but not in Electron (chromium v58.0.3029.110)

Electron loads the url of the app in a browser window like a user would do and I get this error at launch:

ReconnectingWebSocket is not defined

Whatever I do (including the lib just before the implementation in the same file) I get this error.

@jeeftor
Copy link

jeeftor commented Apr 2, 2018

Try
import ReconnectingWebSocket from 'reconnecting-websocket'

@yq5858588
Copy link

不行啊 我的也不行提示这个没有定义 我的跟他的是一样的 我们就是把普通的网页嵌入electron 正常网页是好的 但是嵌入后就不行了出错了 你上面说的方法是解决纯nodejs编写的应用的 我们的方式是用electron简单加载了我们的网页而已 所以你说的方法解决部了啊

@UEhQZXI
Copy link

UEhQZXI commented Mar 20, 2019

Try this solution

<script src="./js/reconnecting-websocket.js"></script>

<script>if (typeof module === 'object') {window.ReconnectingWebSocket = window.ReconnectingWebSocket = module.exports;};</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants