Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open JSON file #105

Open
wvengen opened this issue Jan 31, 2023 · 2 comments
Open

Cannot open JSON file #105

wvengen opened this issue Jan 31, 2023 · 2 comments

Comments

@wvengen
Copy link

wvengen commented Jan 31, 2023

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) {
wvengen added a commit to q-m/replayweb.page-docker that referenced this issue Jan 31, 2023
@iloverails
Copy link

I believe there is need to check Content-length header, if it's incorrect or empty than you will get that error as well

@ikreymer
Copy link
Member

I think this should now be fixed in latest versions of wabac.js -- we have collections sharing for public collections, which allows you to load .json URLs directly via ReplayWeb.page. If it is happening, do you have a specific repro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants