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

ERROR: Cannot read properties of undefined (reading 'table') #1865

Closed
nictru opened this issue Aug 7, 2024 · 5 comments
Closed

ERROR: Cannot read properties of undefined (reading 'table') #1865

nictru opened this issue Aug 7, 2024 · 5 comments

Comments

@nictru
Copy link

nictru commented Aug 7, 2024

Receied this error when loading a bigbed file. Surprises me as I was already able to load some other bigbed files.

Stacktrace says:

TypeError: Cannot read properties of undefined (reading 'table')
    at getDecoder (igv_dist_igv__esm__js.js?v=874868be:20757:112)
    at BWReader.getBedDataDecoder (igv_dist_igv__esm__js.js?v=874868be:21466:19)
    at BWReader.<anonymous> (igv_dist_igv__esm__js.js?v=874868be:21025:44)

When looking at the location in the source code, I assume the problem occurs in this line. Is it possible that autoSql.table is undefined?

@jrobinso
Copy link
Contributor

jrobinso commented Aug 7, 2024

Well apparently it is possible. Is autoSql itself undefined? I will add a check.

@nictru
Copy link
Author

nictru commented Aug 7, 2024

You are right; autoSql has to be undefined for this to occur - thanks in advance for adding the check!

@jrobinso
Copy link
Contributor

jrobinso commented Aug 7, 2024

Hmm, there's already a check in the line you reference. What version are you using?

    if ("biginteract" === format || (autoSql && ('chromatinInteract' === autoSql.table) || 'interact' === autoSql.table)) {

@nictru
Copy link
Author

nictru commented Aug 8, 2024

I used 2.15 when the error first occurred, upgraded to 3.0.1 afterwards.

When looking at the check:
(autoSql && ('chromatinInteract' === autoSql.table) || 'interact' === autoSql.table)

Let's say autoSql is undefined, then we get:
(FALSE && ('chromatinInteract' === autoSql.table) || 'interact' === autoSql.table)

which leads to
(FALSE || 'interact' === autoSql.table)

and then
('interact' === autoSql.table)

So yes there is a check, but the way the brackets are arranged it is not effective.
But should be an easy fix:

if ("biginteract" === format || (autoSql && (('chromatinInteract' === autoSql.table) || ('interact' === autoSql.table)))) {

@jrobinso
Copy link
Contributor

jrobinso commented Aug 8, 2024

Ahh yes, I see now, the parens are out of place, thanks. That is a bug, will fix it.

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

2 participants