electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 99 forks source link

enableLiveReload not working #289

Open kneumei opened 6 years ago

kneumei commented 6 years ago

Whenever I try to use enableLiveReload(), I get a stack trace like this:

App threw an error during load
TypeError: global.globalCompilerHost.listenToCompileEvents(...).filter is not a function
    at enableLiveReloadNaive (C:\Users\Kyle\Documents\Github\electron-quick-start\node_modules\electron-compile\lib\live-reload.js:72:76)
    at enableLiveReload (C:\Users\Kyle\Documents\Github\electron-quick-start\node_modules\electron-compile\lib\live-reload.js:49:7)
    at enableLiveReload (C:\Users\Kyle\Documents\Github\electron-quick-start\node_modules\electron-compile\lib\index.js:35:12)
    at Object.<anonymous> (C:\Users\Kyle\Documents\Github\electron-quick-start\main.js:4:1)
    at Object.<anonymous> (C:\Users\Kyle\Documents\Github\electron-quick-start\main.js:67:3)

Steps to reproduce:

  1. git clone https://github.com/electron/electron-quick-start.git
  2. Edit package.json. change "electron": "~1.7.8" to "electron-prebuilt-compile": "1.8.2-beta.3"
  3. npm install
  4. Edit main.js. Set first to lines to
    import {enableLiveReload} from 'electron-compile';
    enableLiveReload();
  5. npm start
kneumei commented 6 years ago

Follow up:

I did some digging around in electron-forge and found that if I do this in package.config and run npm start, things work for me.

  "main": "src/main.js",
  "scripts": {
    "start": "node ./node_modules/electron-prebuilt-compile/lib/cli.js ."
  },
Knaackee commented 6 years ago

I got the same error, but this does not help.

isekaimaou1109 commented 4 years ago

yeah me too, need help !! tks in advanced

chadbr commented 4 years ago

@isekaimaou1109 this project is deprecated...

image

https://github.com/electron-userland/electron-compile/blob/master/README.md

isekaimaou1109 commented 4 years ago

@isekaimaou1109 this project is deprecated...

image

https://github.com/electron-userland/electron-compile/blob/master/README.md

ok i understood and tks