nurpax / petmate

PETSCII editor with Electron/React/Redux
MIT License
181 stars 14 forks source link

Black window when run from source #123

Closed dubst3pp4 closed 5 years ago

dubst3pp4 commented 5 years ago

Hello, thanks at first for this wonderful editor. Today I tried to install it on Fedora 28 but when started, it shows a black window with the menubar, but clicking File > New or File > Open does nothing.

I've run it with:

npm install
npm start

When running npm install I got this error:

!! No flow@v0.74.0-compatible libdefs found in flow-typed for the above untyped dependencies !!

I've generated any-typed stubs for these packages, but consider submitting libdefs for them to https://github.com/flowtype/flow-typed/

Can you give me an hint how to start it properly? Thanks, Marc

nurpax commented 5 years ago

If you want to run from source, you need to either build a production install package with npm package or use npm run dev (or yarn dev). The start target is buggy, it fails to load some resources files in that configuration and I never got around to fixing it because I tend to use dev for development.

I think the bug is here:

https://github.com/nurpax/petmate/blob/ab60a9d96d299caa9286e4aed04b5cf214267b78/app/utils/index.js#L225

  let abspath = isDev ?
    path.resolve(__dirname, filename) :
    path.resolve(appPath, filename)

IIRC the appPath path works only in an actually packaged build. But isDev is not set when using npm start, so it fails to load the file.

I'd be happy to accept a patch that fixes this if you know how to fix this with Electron. I did notice that later versions of Electron add some variables that can be used to detect whether the code is running as packaged or as dev.

The dev target should work but mind that it is a LOT slower.

Oh right.. You tried to do this because I only package this as a .deb? I haven't spent much time on Linux porting although I know it does work on Ubuntu. But have heard one complaint that there were some problems on Ubuntu 18.x.

nurpax commented 5 years ago

I completely rewrote the package.json scripts. This should not happen anymore, and if it does, please file a new bug.