obs-studio-node-example icon indicating copy to clipboard operation
obs-studio-node-example copied to clipboard

Failed to host and connect

Open jpa44 opened this issue 4 years ago • 7 comments

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.

jpa44 avatar Nov 02 '20 11:11 jpa44

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)?

Envek avatar Nov 02 '20 12:11 Envek

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 ;)

jpa44 avatar Nov 02 '20 13:11 jpa44

@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.

hrueger avatar Nov 02 '20 14:11 hrueger

@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()
  },

jpa44 avatar Nov 02 '20 14:11 jpa44

@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?

hamburger-l avatar Aug 09 '21 10:08 hamburger-l

Me or @jpa44 ?

hrueger avatar Aug 09 '21 11:08 hrueger

Me or @jpa44 ?

@jpa44

hamburger-l avatar Aug 09 '21 12:08 hamburger-l