newo-2001 / MC-Modpack-Downloader

Script to download Minecraft modpacks without the need for the FTB app or Overwolf
MIT License
32 stars 4 forks source link

Download fail: Unexpected end of JSON input #8

Closed destruktoid closed 8 months ago

destruktoid commented 8 months ago

Downloading packs using modpacks.ch hangs after configs are downloaded with the error "SyntaxError: Unexpected end of JSON input". Node version 20.11.0

Also attempted with node 19.7.0 with same outcome

newo-2001 commented 8 months ago

I will look into it, could you provide a modpack and version id that should reproduce the issue?

destruktoid commented 8 months ago

Tried with two packs: 119;11614 120;11425

newo-2001 commented 8 months ago

I can not reproduce it with any combination of the provided nodejs versions and modpacks.

Could it be that your settings.json file is incorrectly formatted? Could you post its contents? (don't forget to censor the CurseForge api key)

Also if the error comes with a stacktrace or any other kind of extra information I would be very interested in seeing that as well.

destruktoid commented 8 months ago

Doesn't appear to have formatting broken. There is absolutely no other information provided which is really annoying mpdl

{
    "downloads": {
        "concurrency": 10,
        "outputDirectory": "mods"
    },
    "curseforge": {
        "apiKey": ""
    },
    "modpacks.ch": {
        "modpack": {
            "id": 120,
            "version": 11425
        }
    }
}
newo-2001 commented 8 months ago

I added more extensive logging and tracing in e3c7842.

If you could do the following, I can investigate the issue in more detail:

  1. Pull the new version
  2. run npm install again (new dependency)
  3. run the script again
  4. attach latest.log to this thread.
destruktoid commented 8 months ago

latest.log

newo-2001 commented 8 months ago

I can reproduce the issue now, the downloads that are failing are the ones being delegated to CurseForge. The problem is that your API key is invalid or not working. I will update the script to make this report a clear error message.

newo-2001 commented 8 months ago

Resolved in ebcedf5.

If you encounter any issues getting it to work feel free to re-open the issue.

newo-2001 commented 7 months ago

The issue of CurseForge rejecting valid API keys is now being tracked in #9.