hmlendea/gfn-electron

JS Exception on start

Radeox opened this issue ยท 25 comments

Hello there!
I've tried to launch the new version (1.5.0) through the zip archive and I get this error:

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Cannot read properties of undefined (reading 'start')
    at Object.<anonymous> (/opt/geforcenow-electron/resources/app.asar/scripts/rpc.js:4:26)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/opt/geforcenow-electron/resources/app.asar/scripts/main.js:4:24)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
(node:50129) UnhandledPromiseRejectionWarning: Error: Could not connect
    at Socket.onerror (/opt/geforcenow-electron/resources/app.asar/node_modules/discord-rpc/src/transports/ipc.js:32:16)
    at Object.onceWrapper (node:events:510:26)
    at Socket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Compiling from source works so I don't know if I'm missing something.

hmm, try adding --disable-rpc to the startup in the start command in package.json my guess is you don't have discord open on your pc not web

could you try to tell me how to reproduce the error so then i can help better?

I've just downloaded the geforcenow-electron_1.5.0_linux.zip and tried to run it with ./geforcenow-electron

I've just downloaded the geforcenow-electron_1.5.0_linux.zip and tried to run it with ./geforcenow-electron

can you try unzipping and in that folder in the terminal write npm install && npm start and enter

There is no package.json in the zip

There is no package.json in the zip

thats the problem alright, now write npm init -y && npm install electron discord-rich-presence && electron . i suggest looking at the source and just copy that package.json

There is no package.json in the zip

im guessing the source only gives the code, not the package files

Still not working:

Error launching app
Unable to find Electron app at ***/geforce

Cannot find module '***/geforce/scripts/main.js'. Please verify that the package.json has a valid "main" entry

I've checked the 1.4.0 release zip and the package.json is missing there too, but it's working so I think the problem is somewhere else. I've tested with discord desktop open and have the same error

Still not working:

Error launching app
Unable to find Electron app at ***/geforce

Cannot find module '***/geforce/scripts/main.js'. Please verify that the package.json has a valid "main" entry

I've checked the 1.4.0 release zip and the package.json is missing there too, but it's working so I think the problem is somewhere else. I've tested with discord desktop open and have the same error

since i want this to be simple for you, go to the github repo and in the master branch take the package.json and put it in your folder replacing it then do npm install && npm start

That's exactly what I did ๐Ÿ˜„

That's exactly what I did ๐Ÿ˜„

do cd geforce && npm install && npm start
also if needed copy the package.json

github has a folder inside a folder when you unzip it

I was in the folder obviously ๐Ÿ‘๐Ÿป

I was in the folder obviously ๐Ÿ‘๐Ÿป

about this, ill give a zip file that is bound to work

But it's working for you?

I already tried that one and worked fine.

Write npm install && npm start in terminal after you extract it and in the same folder or run bash start.sh (made myself)

That zip works, I'm using the "compiled" one, geforcenow-electron_1.5.0_linux.zip for building the AUR package

That zip works, I'm using the "compiled" one, geforcenow-electron_1.5.0_linux.zip for building the AUR package

okay thats great that it works for you, now i kinda understand what your trying to do now

i guess you can compile it yourself? if you can

Yeah, I could but since it's was working till this version I tought it's was an error in the zip

I've changed the AUR script to build the package from source so this issue can be closed if not a problem for others ๐Ÿ˜„

I installed it via snap store and got the same problem:

> geforcenow-electron
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Cannot read properties of undefined (reading 'start')
    at Object.<anonymous> (/snap/geforcenow-electron/10/resources/app.asar/scripts/rpc.js:4:26)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/snap/geforcenow-electron/10/resources/app.asar/scripts/main.js:4:24)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)

(geforcenow-electron:12053): Gtk-WARNING **: 20:34:09.342: Theme parsing error: gtk.css:1418:23: 'font-feature-settings' is not a valid property name

(geforcenow-electron:12053): Gtk-WARNING **: 20:34:09.346: Theme parsing error: gtk.css:3295:25: 'font-feature-settings' is not a valid property name

(geforcenow-electron:12053): Gtk-WARNING **: 20:34:09.347: Theme parsing error: gtk.css:3757:23: 'font-feature-settings' is not a valid property name
(node:12053) UnhandledPromiseRejectionWarning: Error: Could not connect
    at Socket.onerror (/snap/geforcenow-electron/10/resources/app.asar/node_modules/discord-rpc/src/transports/ipc.js:32:16)
    at Object.onceWrapper (node:events:510:26)
    at Socket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
(Use `geforcenow-electron --trace-warnings ...` to show where the warning was created)
(node:12053) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

Thank you, for the super fast response ๐Ÿฅ‡
I can confirm it works now perfectly via the snap store ๐Ÿ˜ƒ