Plots2: Javascript buttons not working across site

Created on 9 Mar 2019  ยท  18Comments  ยท  Source: publiclab/plots2

It looks like jQuery may be not loaded or could be loaded twice, not sure, but in any case the header buttons and other JavaScript across the site are currently broken, unfortunately. We'd love help solving this urgently! Thanks!

bug help wanted high-priority

Most helpful comment

I figured removing the module variable doesn't affect anything else but clears the error. But that may be risky since I'm not completely aware why it was put there! Thank you though, I learnt a thing or two in this.

All 18 comments

Looks like a quick fix @jywarren can I try?

Oh goodness that'd be great, even just copying in whatever errors we see
would be helpful.

This can often happen when jQuery is included twice but it may not be easy
to tell that that's happened. But any insight is welcome and appreciated
thank you!!!

On Sat, Mar 9, 2019, 8:22 AM GettyOrawo notifications@github.com wrote:

Looks like a quick fix @jywarren https://github.com/jywarren can I take
it up?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/4973#issuecomment-471176520,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ1r8F6vieW8VEhNxeiIs1-nofXE-ks5vU7V-gaJpZM4bmrQV
.

Alright I'll let you know if I hit any blockers.

Thank you so much!!!

On Sat, Mar 9, 2019, 8:32 AM GettyOrawo notifications@github.com wrote:

Alright I'll let you know if I hit any blockers.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/4973#issuecomment-471177256,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ11jdoEX-8Gb7CnTg1f7rqyuxY-Bks5vU7fNgaJpZM4bmrQV
.

hey @jywarren I can't seem to reproduce this behaviour. What buttons aren't responding?

Ah, if you click the word profile in the navbar, it should open a menu. Try
it on the live site maybe? If it's not happening in your local copy that's
a clue! Then maybe somehow it could relate to our JavaScript assets
compilation when we publish.

On Sat, Mar 9, 2019, 8:53 AM GettyOrawo notifications@github.com wrote:

hey @jywarren https://github.com/jywarren I can't seem to reproduce
this behaviour. What buttons aren't responding?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/4973#issuecomment-471178912,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJyYyXHwqIKtpogOS6pVc_8o6KEkcks5vU7ytgaJpZM4bmrQV
.

oh. It works fine locally. Though on the live site even login doesn't respond. I should try track down why that's the case

Hey @jywarren, how about reverting this for now - https://github.com/publiclab/plots2/pull/4904/files#diff-a9c3bd311eab80c9ebe6a69830f9ad02R18 as the module is not loaded - https://travis-ci.org/publiclab/plots2/builds/503876232#L3253?

But @gauravano I believe we solved that because @icarito manually ran yarn
install, but I am also afraid to revert all of it since it was
unfortunately not squashed for some reason and will it undo a lot of
previous commits?

What if we merge this? https://github.com/publiclab/plots2/pull/4968

On Sat, Mar 9, 2019, 9:42 AM Gaurav Sachdeva notifications@github.com
wrote:

Hey @jywarren https://github.com/jywarren, how about reverting this for
now -
https://github.com/publiclab/plots2/pull/4904/files#diff-a9c3bd311eab80c9ebe6a69830f9ad02R18
as the module is not loaded -
https://travis-ci.org/publiclab/plots2/builds/503876232#L3253?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/4973#issuecomment-471183460,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ1vVgYC3n5IG042LChRA1j5Gsjneks5vU8grgaJpZM4bmrQV
.

Aha! @GettyOrawo your observation that it works locally was key here, thank you! I think i got it:

In Travis, we see:

ReferenceError: Can't find variable: module
  # debounce/index.self-2be1b4e8a2646f67c540dc7cb7fc167f9b219fdddbc64e8ebd753202b1389385.js:71 -- global code
.Faked response to: /likes/node/1/create

and actually in local, the same shows in the console. But in development mode each file is added separately, so that only interrupts the debounce library loading, no other JS file. In production, all are compiled into one giant JS file, and so that error interrupts almost ALL javascript across the site from loading. We can fix this!!!!

fix in https://github.com/publiclab/plots2/pull/4976 --- confirmed this locally and will push to stable for final checks!

We'll switch back to the main debounce library away from my temporary fix if they pull in my pull request ๐Ÿ˜„

Thanks again to @GettyOrawo and @gauravano -- fingers ๐Ÿคž here but I think we got this ๐Ÿ™Œ

Yes makes perfect sense. Let's wait on it !

I figured removing the module variable doesn't affect anything else but clears the error. But that may be risky since I'm not completely aware why it was put there! Thank you though, I learnt a thing or two in this.

๐Ÿ˜„ yeah -- me too! The module variable is used in CommonJS format when we can include a JS file or package into another using require(path). But here, we don't have Rails set up to do that (yet??? ๐Ÿ˜„ ) so we have to treat it like it's just directly being used in the browser. We honestly don't often have these issues, but our JS in this project is starting to need some tidying up as it gets more complex. Thank you again!

@jywarren I am a little confused here - how that unstable build - https://jenkins.laboratoriopublico.org/job/Plots-Unstable/549/ passed if you fixed the debounce one after that push?

As in unstable build logs, it seems module got installed properly with just @icarito's PR(without your patch being included), so why do you changed the package to point to your patch instead?

Ah, because there was another issue related to module not being defined
that my patch fixed. Thanks!

On Sat, Mar 9, 2019, 1:53 PM Gaurav Sachdeva notifications@github.com
wrote:

@jywarren https://github.com/jywarren I am a little confused here - how
that unstable build -
https://jenkins.laboratoriopublico.org/job/Plots-Unstable/549/ passed if
you fixed the debounce one after that push?

As in unstable build logs, it seems module got installed properly with
just @icarito https://github.com/icarito's PR(without your patch being
included), so why do you changed the package to point to your patch instead?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/4973#issuecomment-471211317,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ6v3Nj0LHRE5WE3eITIl0jiWWQISks5vVALvgaJpZM4bmrQV
.

Was this page helpful?
0 / 5 - 0 ratings