Envek / obs-studio-node-example

Learn how to use OBS Studio from your Electron app for screen video recording
GNU General Public License v2.0
99 stars 19 forks source link

Failed to host and connect #27

Open jpa44 opened 3 years ago

jpa44 commented 3 years ago

Hi i'm using vue-cli-service with your exemple and i have this error : Failed to host and connect. I'm blocked and i don't kno how to solve this thanks !

> vue-cli-service electron:serve

 INFO  Starting development server...
 WARN  Express server  You have to launch the express server before if you want to use relative path in your code!
98% after emitting CopyPlugin

 DONE  Compiled successfully in 4528ms                                                                          10:21:51

  App running at:
  - Local:   http://localhost:8081/
  - Network: http://192.168.1.26:8081/

  Note that the development build is not optimized.
  To create a production build, run yarn build.

|  Bundling main process...

 DONE  Compiled successfully in 4346ms                                                                          10:21:56

  File                      Size                                         Gzipped

  dist_electron\index.js    3259.55 KiB                                  690.34 KiB

  Images and other types of assets omitted.

 INFO  Launching Electron...
initialize
Error: Failed to host and connect.
    at initOBS (webpack:///./obsRecorder.js?:40:25)
    at Object.initialize (webpack:///./obsRecorder.js?:22:5)
    at App.eval (webpack:///./src/background.js?:107:17)
    at App.emit (events.js:205:15)
(node:8452) UnhandledPromiseRejectionWarning: Error: Exception when initializing OBS process: Error: Failed to host and connect.
Envek commented 3 years ago

What is your OS and Node version? I've tested it only on Windows with Node,js 12.

Does it work without that vue-cli-service (sorry, I don't know what is it), if you just do yarn install and yarn start (as stated in README)?

jpa44 commented 3 years ago

hey i'm on windows 10 with : node : 12.4.0 and electron 6.1.9

i use vue-cli-plugin-electron-builder to works with vuejs on electron. Without this package the example works fine.

i use npm i will try with yarn to see Thanks ;)

hrueger commented 3 years ago

@jpa44 I have an Angular project and it internally uses Webpack (which I belive your vue-cli-plugin-electron-builder does, too). I had to add a loader for .node files. See those lines.

jpa44 commented 3 years ago

@hrueger yes i did this in my vue.config.js because i struggled with NODE_MODULE_VERSION error i will take a look to your main.js btw Thanks !

  chainWebpack: config => {
    config.module
        .rule('node')
        .test(/\.node?$/)
        .use('node-loader')
        .loader('node-loader')
        .end()
  },
hamburger-l commented 2 years ago

@hrueger yes i did this in my vue.config.js because i struggled with NODE_MODULE_VERSION error i will take a look to your main.js btw Thanks !

  chainWebpack: config => {
    config.module
        .rule('node')
        .test(/\.node?$/)
        .use('node-loader')
        .loader('node-loader')
        .end()
  },

@hrueger yes i did this in my vue.config.js because i struggled with NODE_MODULE_VERSION error i will take a look to your main.js btw Thanks !

  chainWebpack: config => {
    config.module
        .rule('node')
        .test(/\.node?$/)
        .use('node-loader')
        .loader('node-loader')
        .end()
  },

Have you solved the problem?

hrueger commented 2 years ago

Me or @jpa44 ?

hamburger-l commented 2 years ago

Me or @jpa44 ?

@jpa44