electron-userland / electron-compile

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

Trying to open application from a fresh electron-compile install fails #318

Closed thibmaek closed 4 years ago

thibmaek commented 5 years ago

In my app I get the following error with grabbing the latest electron-prebuilt-compile version from npm ("electron-prebuilt-compile": "^4.0.0-beta.5") and "electron": "^3.0.6":

App threw an error during load
TypeError: _fs2.default.statSyncNoException is not a function
    at findPackageJson (/Users/thibault/Bitbucket/xxx/node_modules/electron-prebuilt-compile/lib/es6-init.js:25:20)
    at main (/Users/thibault/Bitbucket/xxx/node_modules/electron-prebuilt-compile/lib/es6-init.js:44:23)
    at Object.<anonymous> (/Users/thibault/Bitbucket/xxx/node_modules/electron-prebuilt-compile/lib/es6-init.js:61:1)
    at Object.<anonymous> (/Users/thibault/Bitbucket/xxx/node_modules/electron-prebuilt-compile/lib/es6-init.js:63:3)
    at Module._compile (internal/modules/cjs/loader.js:693:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at loadApplicationPackage (/Users/thibault/Bitbucket/xxx/node_modules/electron-prebuilt-compile/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:119:12)

Commands:

$ npm install electron-prebuilt-compile --save-dev
$ npm start
> tsc
> electron ./dist/main.js

main.ts:

import { enableLiveReload } from 'electron-compile';

enableLiveReload();

let mainWindow: Electron.BrowserWindow;

const createWindow = () => {
  mainWindow = new BrowserWindow(windowConfig);
};

Typescript config:

{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "noImplicitAny": true,
    "sourceMap": true,
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "*": ["node_modules/*"]
    }
  },
  "include": [
    "src/**/*"
  ]
}
johanalkstal commented 5 years ago

I'm getting this with the latest version.

ICarryTheDustOfAJourney commented 5 years ago

I just started a brand new setup following the instructions on the website, got the same when doing

npm install -g electron-forge
electron-forge init my-new-project
electron-forge start

Windows10, Electron v4.0.0 Chromium v69.0.3497.106 Node v10.11.0 v8 v6.9.427.24-electron.0