Skip to content

Cannot open JSON file #105

@wvengen

Description

@wvengen

When loading a JSON file pointing to an archive (one served by browsertrix-cloud), I get the error message

Sorry, this URL could not be loaded because the size of the file is not accessible.
Make sure this is a valid URL and you have access to this file.

It appears that for JSON files the sourceLoader does not return a length in this case

wabac.js/src/loaders.js

Lines 562 to 570 in d7e0021

if (!sourceLoader.length) {
progressUpdate(0, `\
Sorry, this URL could not be loaded because the size of the file is not accessible.
Make sure this is a valid URL and you have access to this file.`);
if (abort) {
abort.abort();
}
return false;
}

And indeed, when disabling this check, the archive is loaded correctly.
Does it make sense to replace this conditional by the following (which works for me)?

if (sourceLoader.canLoadOnDemand && !sourceLoader.length) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions