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

Fails in Electron renderer process #125

Open
iosimliviu opened this issue Dec 20, 2021 · 3 comments
Open

Fails in Electron renderer process #125

iosimliviu opened this issue Dec 20, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@iosimliviu
Copy link

  • I'm submitting a ...
    [ x ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    Everything works fine until I try to make a call to atem.connect()

In which case I run into the following error:

Uncaught (in promise) Error: The V8 platform used by this instance of Node does not support creating Workers
    at new Worker (internal/worker.js:148)
    at new WorkerThread (/Users/liviuiosim/Do…workerThreads.js:14)
    at Object.forkWorkerThread (/Users/liviuiosim/Do…workerThreads.js:52)
    at ThreadedClassManagerClassInternal._createFork (/Users/liviuiosim/Do…cess/manager.js:569)
    at ThreadedClassManagerClassInternal.findNextAvailableChild (/Users/liviuiosim/Do…cess/manager.js:126)
    at /Users/liviuiosim/Do…hreadedClass.js:144
    at new Promise (<anonymous>)
    at Object.threadedClass (/Users/liviuiosim/Do…threadedClass.js:29)
    at AtemSocket.<anonymous> (/Users/liviuiosim/Do…ib/atemSocket.js:90)
    at Generator.next (<anonymous>)
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

I understand that this might be more of an Electron issue, as specified here, and here

I have the following BrowserWindow options:

win = new BrowserWindow({
    webPreferences: {
      nodeIntegrationInWorker: true,
      nodeIntegration: true,
      allowRunningInsecureContent: (serve) ? true : false,
    },
  });

With the following versions:

"electron": "^11.3.0",
"atem-connection": "^2.4.0",

Is there any other implementation with an electron-friendly thread library? Or does anybody have an idea of a potential fix?

@Julusian Julusian added the bug Something isn't working label Dec 20, 2021
@Julusian Julusian changed the title Not compatible with Electron Fails in Electron renderer thread Dec 20, 2021
@Julusian Julusian changed the title Fails in Electron renderer thread Fails in Electron renderer process Dec 20, 2021
@Julusian
Copy link
Member

I know the library works when used in the main electron process, but it appears that the renderer process is doing something odd that is tripping up the threading library.

The only suggestion I have for now is to not use it in the renderer process. Or you could try enabling the option disableMultithreaded, but that is likely to cause the connection to die when other cpu intensive stuff is happening in your app.

I am not sure when I will have a chance to look at fixing the underlying issue. The threading library we use does support web-workers, but I have never tried that so it might not be easy

@iosimliviu
Copy link
Author

Thank you for your response. It indeed works well in the main electron process.

I am having some issues when the application is packed versus not packed. Basicly when running it in the development environement it works, and when I make a build it doesn't, the connection is not taking place.

Have you guys encountered anything similar?

I am using "electron-builder": "^22.11.7" with "electron": "^11.5.0" for builds.

@Laiba-Akram
Copy link

  • I'm submitting a ...
    [ x ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project
  • Summary
    Everything works fine until I try to make a call to atem.connect()

In which case I run into the following error:

Uncaught (in promise) Error: The V8 platform used by this instance of Node does not support creating Workers
    at new Worker (internal/worker.js:148)
    at new WorkerThread (/Users/liviuiosim/Do…workerThreads.js:14)
    at Object.forkWorkerThread (/Users/liviuiosim/Do…workerThreads.js:52)
    at ThreadedClassManagerClassInternal._createFork (/Users/liviuiosim/Do…cess/manager.js:569)
    at ThreadedClassManagerClassInternal.findNextAvailableChild (/Users/liviuiosim/Do…cess/manager.js:126)
    at /Users/liviuiosim/Do…hreadedClass.js:144
    at new Promise (<anonymous>)
    at Object.threadedClass (/Users/liviuiosim/Do…threadedClass.js:29)
    at AtemSocket.<anonymous> (/Users/liviuiosim/Do…ib/atemSocket.js:90)
    at Generator.next (<anonymous>)
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

I understand that this might be more of an Electron issue, as specified here, and here

I have the following BrowserWindow options:

win = new BrowserWindow({
    webPreferences: {
      nodeIntegrationInWorker: true,
      nodeIntegration: true,
      allowRunningInsecureContent: (serve) ? true : false,
    },
  });

With the following versions:

"electron": "^11.3.0",
"atem-connection": "^2.4.0",

Is there any other implementation with an electron-friendly thread library? Or does anybody have an idea of a potential fix?

Updated the electron version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants