HMCL-dev/HMCL · error · JsonParseException
CurseForge Manifest.gameVersion cannot be blank.
Error message
CurseForge Manifest.gameVersion cannot be blank.
What it means
Post-deserialization validation of the 'minecraft' section of a CurseForge manifest: gameVersion (mapped from the 'version' JSON field) must be non-blank, otherwise the modpack's target Minecraft version is unknown and the manifest is rejected.
Solutions
- Set minecraft.gameVersion to a valid Minecraft version (e.g. "1.20.1") in manifest.json
- Re-export the modpack from the CurseForge app
- Use a different source archive whose manifest is complete
Example fix
// before
{"minecraft":{"version":"1.0.0","modLoaders":[...]}}
// after
{"minecraft":{"version":"1.0.0","gameVersion":"1.20.1","modLoaders":[...]}} Defensive patterns
Strategy: validation
Validate before calling
if (manifest.getMinecraft() == null || isBlank(manifest.getMinecraft().getGameVersion())) { /* reject manifest before install */ } Type guard
boolean hasGameVersion(CurseManifestMinecraft m) { return m != null && m.getGameVersion() != null && !m.getGameVersion().isBlank(); } Try / catch
try { minecraft.validate(); } catch (JsonParseException e) { log.error("Manifest missing gameVersion", e); } Prevention
- Always include minecraft.gameVersion in curse manifests
- Test-parse every exported manifest before distribution
- Diff manifests against a known-good sample after edits
When it happens
Trigger: Parsing a curse manifest.json whose minecraft.gameVersion is empty, whitespace-only, or absent, then calling validate().
Common situations: Incomplete/buggy manifest export, hand-edited manifest where gameVersion was deleted, minimal test manifests missing required fields.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Instance
- Missing Project ID or File ID.
- Curse Forge modpack manifest Mod loader id cannot be blank.
- Invalid library path:
- /assets/
AI-assisted analysis of HMCL-dev/HMCL@24702dc5a0 (2026-09-10).
Data as JSON: /api/errors/52cedbb7bb6fc121.
Report an issue: GitHub.
Appendix: source
Thrown at HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/curse/CurseManifestMinecraft.java:48
@Override
public void validate() throws JsonParseException {
if (StringUtils.isBlank(gameVersion))
throw new JsonParseException("CurseForge Manifest.gameVersion cannot be blank.");
}View on GitHub (pinned to 24702dc5a0)