wilzbach / msa

Modular BioJS compoment for a multiple sequence alignment
http://msa.biojs.net
Boost Software License 1.0
168 stars 79 forks source link

MSA viewer is not loading... #260

Closed l-singh-biomsu closed 2 years ago

l-singh-biomsu commented 3 years ago

Hello, I am using Ubuntu 18.04 Chromium v92.0.4515.131 MSA vier is not laoding. It crushes with error Uncaught TypeError: seqs.on is not a function. Please fix this bug soon, I rely on it!

JacobPorter commented 3 years ago

This seems related to Issue #259. I am a developer for bv-brc.org, and we use this viewer. It has recently stopped working for us when Firefox and Chromium were upgraded to the latest releases. Chrome rendering stopped working in version 92.0.4515.131, and Firefox rendering stopped working on version 90.0.2.

l-singh-biomsu commented 3 years ago

Is there any ideas how to fix the issue? I just tried this workaround from the isuue #257. Some configurations are missed, but it works.

dmachi commented 3 years ago

@l-singh-biomsu The issue is the 'at' in seqs portion of https://github.com/wilzbach/stat.seqs/blob/master/lib/index.js#L52

at() is now a method of JS Arrays on Chrome/FF (but not on Safari and other browsers yet) and so this check doesnt' do what is expected.

We replaced this with a check like '_byId' in seqs that works for our particular case because of the data we're initially passing in, but I am not sure if it is a valid general solution for others. If not a different check will need to be applied there.

guignonv commented 3 years ago

How about checking 'on' instead of '_byId' since it's that method which is called?

websemantics commented 3 years ago

Building on @dmachi's comment, add the following before instantiating msa

delete Array.prototype.at 

Not ideal but it works

huy-nguyen commented 3 years ago

I've made a fix for this on my own fork that I think is more robust. https://github.com/niaid/msa/pull/2/commits/e82512e8512e46d77e15ff04368596d9504b277a