Encountering an Issue
C:\Development\AlphaLauncher-Recode\app\assets\js\loggerutil.js:29 [Launcher] TypeError: json is not iterable
at DistroIndex._resolveInstances (C:\Development\AlphaLauncher-Recode\app\assets\js\distromanager.js:260)
at Function.fromJSON (C:\Development\AlphaLauncher-Recode\app\assets\js\distromanager.js:253)
at Request._callback (C:\Development\AlphaLauncher-Recode\app\assets\js\distromanager.js:327)
at Request.self.callback (C:\Development\AlphaLauncher-Recode\node_modules\request\request.js:185)
at Request.emit (events.js:203)
at Request.<anonymous> (C:\Development\AlphaLauncher-Recode\node_modules\request\request.js:1161)
at Request.emit (events.js:203)
at IncomingMessage.<anonymous> (C:\Development\AlphaLauncher-Recode\node_modules\request\request.js:1083)
at Object.onceWrapper (events.js:291)
at IncomingMessage.emit (events.js:208)
This is the error message that appears when attempting to run the launcher that was created. The source code has not been shared publicly on my github yet; however, the goal is to retrieve the distribution index from my dropbox in order for the launcher to successfully load the instance needed to run.
Examining the code for the request and catch.
exports.DistroIndex;
exports.Types = {
Library: 'Library',
ForgeHosted: 'ForgeHosted',
Forge: 'Forge',
ForgeMod: 'ForgeMod',
File: 'File',
VersionManifest: 'VersionManifest'
}
let data = null;
exports.pullRemote = async function(distroURL) {
return new Promise((resolve, reject) => {
let opts = {
url: distroURL,
timeout: 10000
}
request(opts, (error, _resp, body) => {
if(!error) {
try {
data = DistroIndex.fromJSON(JSON.parse(body));
resolve(data);
}
catch (e) {
reject(e);
}
}
else {
reject(error);
}
});
});
}
exports.getDistribution = function() {
return data;
}
I have been troubleshooting this for some time now. Any suggestions on how to resolve this issue? I have been attempting to fix it on my own, but perhaps with a fresh perspective, we can work together to find a solution.
Just to provide some context, this is a minecraft launcher with features like automatic updates and modded jar downloads.