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

TypeError: o is undefined #192

Open
audiojunky23 opened this issue Apr 14, 2024 · 12 comments
Open

TypeError: o is undefined #192

audiojunky23 opened this issue Apr 14, 2024 · 12 comments

Comments

@audiojunky23
Copy link

audiojunky23 commented Apr 14, 2024

No matter the settings I use (parse chapters or precise chapters), I get the error "TypeError: o is undefined" and a failed status. This only seemed to have happened within the past 24 hrs or so. Thoughts?

image

@audiojunky23
Copy link
Author

Although I'm not sure why, after looking at some other issues people have had, I can confirmed that doing both a fresh Firefox and manually adding library cards again fixed the problem. A fresh Firefox alone was not enough, so I'm not sure if doing that step was necessary, but the manually adding was key!

@articboy
Copy link

So to clarify, you signed out of your libby account and reinstalled firefox? Not sure I understand the solution here. Or did you get a brand new library card?

@audiojunky23
Copy link
Author

The steps I took are as followed. Uninstalled Firefox and deleted the files within %appdata%. Installed Firefox. And added my cards via the copy from another device. This did not produce the solution. I repeated the first steps again, but this time I manually added my library cards. It worked.

@articboy
Copy link

Ill give it a shot thank you!

@ojbucao
Copy link

ojbucao commented Apr 15, 2024

I'm getting the same issue on a macbook all of a sudden. Re-adding my cards fixed the issue. Simply copying from another device didn't.

@sam-baker
Copy link

I don't know if this is helpful information, but when using the regular firefox, I get the error above, but when I use the developer edition, I get the error : TypeError: can't access property "main", o is undefined. So slightly more detailed.

@Infinite-Actuary
Copy link

Infinite-Actuary commented Apr 16, 2024

Looks like Cloudfront 400 errors when when starting the download and requesting json from:

https://dewey-{id}.listen.libbyshelf.com/_d/openbook.json

libby_request

I see some json in the response:

libby_json

But I don't think it contains the expected details.

EDIT: I think the property TypeError: can't access property "main", o is undefined that @sam-baker mentioned is from this line:

state.title = new Title(title.main, title.subtitle, title.collection);

and was able to confirm the minified background.js has the o object reference that matches the error.

N.title = new n(o.main, o.subtitle, o.collection);

@bookbonobo
Copy link
Owner

I started to run down what I thought was going on with this error, but I just haven't had as much time as I'd like to devote to this extension anymore. Where I left off it seemed to be that typically the dewey server the download needed to hit had been authenticated to as part of browsing the web app. I have run into the circumstances some users are reporting here where you get request failures and that seemed to be when content bridged different dewey servers in the request logs. If that's what's happening I think what needs to happen is just to figure out how to auth to the other servers involved, but I haven't been able to look into what the auth process would look like. In theory it'll be in the network logs in the browser tools somewhere.

The only workaround I've had luck with is letting the loan expire and checking it out again hoping to not hit the edge case the second time around. But it seems like people in the community have been pretty creative in finding other ways to stop it from happening. If anyone has the time/skill to look into this I'd love to accept a PR!

@Infinite-Actuary
Copy link

Should we assume that the 0.5.1 version released today has fixed the "o" not defined issue? It works fine for me, but then mine never had any these problems to begin with, so it's hard for me to tell the difference. 🤔

Looks like 0.5.1 contains formatting changes to the index timestamps. Not anything to do with this issue (not 100% sure though).

0.5.0...0.5.1

What I gathered from @bookbonobo response, if there is a code fix it will have to come from the community.

@Stryfe-Delivery
Copy link

Looks like Cloudfront 400 errors when when starting the download and requesting json from:

https://dewey-{id}.listen.libbyshelf.com/_d/openbook.json

libby_request

I see some json in the response:

libby_json

But I don't think it contains the expected details.

EDIT: I think the property TypeError: can't access property "main", o is undefined that @sam-baker mentioned is from this line:

state.title = new Title(title.main, title.subtitle, title.collection);

and was able to confirm the minified background.js has the o object reference that matches the error.

N.title = new n(o.main, o.subtitle, o.collection);

Is that object needed to initiate the download or is it just used as metadata to make the output zip? If the latter, could we not just put in a placeholder as a catch?

e.g. state.title = new Title(title?.main || '', title?.subtitle || '', title?.collection || '');

I'm hoping to try something like that soon, but these aren't my go-to language/ tools.

@Infinite-Actuary
Copy link

Hi @Stryfe-Delivery, I believe that error is the symptom and not the underlying cause of failed downloads. The main issue is the web request is failing to return the expected json. More details by @ahxxm here: #161 (comment)

@Infinite-Actuary
Copy link

Confirmed this is now working with the latest release 0.6.0. Thanks @bookbonobo & @ahxxm 👏

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

7 participants