dscalzi / HeliosLauncher

☀ Custom launcher for modded minecraft written in Electron and Node.js
MIT License
830 stars 1.72k forks source link

Cannot read properties of undefined (reading 'length') #312

Closed Lord-ZuzurNC closed 9 months ago

Lord-ZuzurNC commented 9 months ago

Hello,

I'm sorry to be the Nth guy with Index error but I can't see, on another ticket the exact error I'm facing... So I am using Helios Launcher 2.0.5 and Nebula. I created my distribution.json and for testing I am hosting everything on my Github repo. So I have URL for everything to be downloaded. I modified the distromanager.js to be my Github URL ending by "distribution.json". So I build the distro without error. And I build the Launcher in windows platform without error.

The error I'm facing when I start the launcher, I copied from Console:

C:\Users\MyUser\Documents\GitHub\ZLauncher\dist\win-unpacked\resources\app.asar\node_modules\winston\lib\winston\transports\console.js:82 [2023-11-13 22:17:58] [error] [Preloader]: Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
    at HeliosDistribution.resolveMainServerIndex (C:\Users\MyUser\Documents\GitHub\ZLauncher\dist\win-unpacked\resources\app.asar\node_modules\helios-core\dist\common\distribution\DistributionFactory.js:20:42)
    at new HeliosDistribution (C:\Users\MyUser\Documents\GitHub\ZLauncher\dist\win-unpacked\resources\app.asar\node_modules\helios-core\dist\common\distribution\DistributionFactory.js:16:14)
    at DistributionAPI.getDistribution (C:\Users\MyUser\Documents\GitHub\ZLauncher\dist\win-unpacked\resources\app.asar\node_modules\helios-core\dist\common\distribution\DistributionAPI.js:40:33)

Here the full log

I am wondering if the issue is not Github, I mean as it is not really a site to download things maybe that's why it isn't able to read the length of anthing? (my lab is fresh and I have to do some conf to create my hosting subdomain, so if Github is the cause I'll pause until I can host properly my files).

Lord-ZuzurNC commented 9 months ago

I have setup a simple nginx container that expose the files and I still can't get on the launcher. I face the exact same error as above. (I can share the link, if requested, as it is just pure download without upload or any other possibility of interaction)

GeekCornerGH commented 9 months ago

GitHub hosting for files is not supported.

Lord-ZuzurNC commented 9 months ago

Yeah I thought about that but now I am hosting these files myself. On a simple nginx container with autoindex. Still thanks for confirming it.

GeekCornerGH commented 9 months ago

I see 2 wrong things regarding your launcher. First of all, you added "hhttps" instead of "https" https://github.com/Lord-ZuzurNC/ZLauncher/blob/54ffbee47b52a51606a0f9a05bd3a005a6d090ee/app/assets/js/distromanager.js#L8 Also maybe it's a me issue (for using Tunnelbroker), but I'm unable to check your distribution.json image

Also since this is not an issue, maybe move to a discussion, or join the Discord (on the readme)

Lord-ZuzurNC commented 9 months ago

Oh well spotted thanks. I'll be able to change this tonight after work (I'm in french time as you). I'll use my new file server to host the distribution.json and try a new build of the launcher. (I'll try to review for any more typo as well) Thank you for your time.

Lord-ZuzurNC commented 9 months ago

That was the typo thx again. Also I had to move all the library in the required folder as they wasn't detected, I don't mind having all in required so no issue on my side. Now I need to make it auto connect but that's not the same issue and so not to be solve here, I'll first read closed and open ticket for that.