v2.ocaml.org icon indicating copy to clipboard operation
v2.ocaml.org copied to clipboard

Track down browser console errors

Open patricoferris opened this issue 3 years ago • 25 comments

Currently when visiting any page of the OCaml.org site, two errors are logged to the console:

Uncaught TypeError: e is not a function
    at bootstrap.min.js:6
    at bootstrap.min.js:6

and

Failed to load resource: the server responded with a status of 404 () -- piwik.js:1

It would be good to resolve these errors and have a clean console, Google has some more information on the matter.

@gunjan543 would you be interested in looking into these errors (as part of #1245), I'm more than happy to help as it might be a little difficult to understand where they are coming from. I highly recommend building the site locally and using something like Chrome Dev tools to investigate. If you are interested or not can you drop a comment below please.

patricoferris avatar Mar 08 '21 09:03 patricoferris

Yes, I am very much interested in working on this issue. Thank you for assigning me this. I will go through it thoroughly and get back to you If I face any issue :)

gunjan543 avatar Mar 08 '21 14:03 gunjan543

image I was working on "Failed to load resource: the server responded with a status of 404 () -- piwik.js:1" and while going through the same I realized that piwik.js does not exist in the directory, so maybe that's why it's giving 404. So what do you think ? Do you think this is the reason for the error? File path: ocaml.org/template/main.mpp

gunjan543 avatar Mar 10 '21 16:03 gunjan543

image I was going through this issue "Uncaught TypeError: e is not a function at bootstrap.min.js:6 at bootstrap.min.js:6" but I am not able to locate this file, can you please guide me where to find this file?

gunjan543 avatar Mar 10 '21 16:03 gunjan543

Uncaught TypeError: e is not a function
    at bootstrap.min.js:6
    at bootstrap.min.js:6

@patricoferris and @gunjan543, I suspect the above error is jquery related. In one of the generated HTML files I was investigating, I came across this bootstrap CDN.

    <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>

Most likely this loaded bootstrap plugin is using jquery. I understand recent versions of bootstrap have dropped using jquery but the version being loaded here is quite old. I tried loading jquery via CDN just before the above CDN and the TypeError in the console seems to disappear. I am not sure if it is the solution or not but you need to do a thorough investigation with the other pages before making a conclusion. I hope that helps.

nibble0101 avatar Mar 15 '21 17:03 nibble0101

@nibble0101 thanks for the help here. @gunjan543 how is this going? Can I help you in any way?

patricoferris avatar Mar 29 '21 15:03 patricoferris

I am looking for another issue to take up. @nibble0101 @gunjan543 @patricoferris, has this issue been resolved or at work in progress level? Please let me know. Thank you

dinakajoy avatar Mar 31 '21 08:03 dinakajoy

Given that @gunjan543 hasn't commented on this issue for 23 days and hasn't answered for 2 days if they need help, I'd say that it would be ok for someone else to give it a go.

@dinakajoy , note that an applicant can only work on one good-first-issue and you've already worked on this one. Thanks for that by the way! So you should now either look for an issue without the good-first-issue-tag or come up with another issue yourself :)

pitag-ha avatar Apr 02 '21 15:04 pitag-ha

@pitag-ha I am only contributing to this project and right now there is not much to do except redesign to modernize the look and feel of the website. I am not working on any stuff now and don't mind taking this up. By the way, are you think of redesigning, like add more space and animation, etc. I can contribute on that as well. Thank you.

dinakajoy avatar Apr 02 '21 16:04 dinakajoy

right now there is not much to do except redesign to modernize the look and feel of the website.

There are 165 open issues that aren't tagged as good-first issues :) You could work on any of those ones.

By the way, are you think of redesigning, like add more space and animation, etc. I can contribute on that as well.

The best thing would be to file a concrete issue with the idea you have in mind. That way we can have a look at the idea and let you know what we think.

And thanks again for your contributions!

pitag-ha avatar Apr 02 '21 17:04 pitag-ha

There are 165 open issues that aren't tagged as good-first issues :) You could work on any of those ones.

@dinakajoy, Patrick has just given a great answer for applicants who have already done a couple of nice contributions here. I think that answer can also be helpful for you :)

pitag-ha avatar Apr 07 '21 18:04 pitag-ha

If I'm no missing anything, this issue is open for folks who want to start contributing :)

pitag-ha avatar Apr 09 '21 11:04 pitag-ha

Hello @pitag-ha, I am an Outreachy intern, and I would like to work on this issue.

Deek9399 avatar Apr 11 '21 15:04 Deek9399

@Deek9399, I've just read the issue again and am not sure how easy it will be. But if you'd like to, you can work on this :)

pitag-ha avatar Apr 12 '21 10:04 pitag-ha

Yes, @pitag-ha I would like to work on this issue.

Deek9399 avatar Apr 13 '21 13:04 Deek9399

@pitag-ha I am only able to see these errors in my console Screenshot from 2021-04-13 19-41-26 Although, I am getting an error GET http://127.0.0.1:5500/img/edit-hover.svg 404 (Not Found) , the image is visible in both normal and hover state, and I am able to resolve it by adding a correct path. I am more concerned about Failed to load resource: the server responded with a status of 404 () -- piwik.js:1 as I am unable to locate this error in my console.

Deek9399 avatar Apr 13 '21 14:04 Deek9399

Have you seen the other error in your console?

Screenshot from 2021-04-14 11-58-18

That's one of the errors this issue is about. :)

About the Failed to load resource error: @patricoferris , do you know if this issue is still up-to-date?

pitag-ha avatar Apr 14 '21 10:04 pitag-ha

@pitag-ha and @Deek9399 I think the issue is still up to date.

I am able to see a similar error related to pwiki.js on the landing page on chrome.

image

nibble0101 avatar Apr 14 '21 10:04 nibble0101

Have you seen the other error in your console?

Screenshot from 2021-04-14 11-58-18

That's one of the errors this issue is about. :)

About the Failed to load resource error: @patricoferris , do you know if this issue is still up-to-date?

Yes!! This error occurs because of the bootstrap. The bootstrap version used here is 2.3.1. I found a similar issue in a different project, here. This error was resolved by using the slightly latest version 3.3.2 which requires jquery. I tried the same steps in my local branch, which solves the issue but since it is a version-related issue thought I should discuss it with @pitag-ha and @patricoferris before creating a PR. What do you think?

Deek9399 avatar Apr 14 '21 10:04 Deek9399

@nibble0101 Can you please share more details of the platform on which you are currently building the website? I am using ubuntu and the browser is google chrome.

Deek9399 avatar Apr 14 '21 10:04 Deek9399

@Deek9399 I am not reproducing it locally on my machine. Try to check on the landing page. I did see it on the local build too though some time back.

nibble0101 avatar Apr 14 '21 10:04 nibble0101

@nibble0101 Yeah, I can see it on the landing page but not in my local environment.

Deek9399 avatar Apr 14 '21 14:04 Deek9399

Have you seen the other error in your console? Screenshot from 2021-04-14 11-58-18 That's one of the errors this issue is about. :) About the Failed to load resource error: @patricoferris, do you know if this issue is still up-to-date?

Yes!! This error occurs because of the bootstrap. The bootstrap version used here is 2.3.1. I found a similar issue in a different project, here. This error was resolved by using the slightly latest version 3.3.2 which requires jquery. I tried the same steps in my local branch, which solves the issue but since it is a version-related issue thought I should discuss it with @pitag-ha and @patricoferris before creating a PR. What do you think?

@patricoferris,@pitag-ha, @gs0510 Please have a look at this comment.

Deek9399 avatar Apr 15 '21 11:04 Deek9399

Hmmm this might be something we can't really fix. Bumping our version of Bootstrap sounds... difficult. I'm guessing the bootstrap CSS and the bootstrap JS are versioned together, so I don't think just bumping the JS will work here because we vendor a (modified?) and older CSS version in site/css/bootstrap.css.

It might be that we use so little of Bootstrap's functionality that it doesn't matter, but then our CSS would be out of sync with the JS by a whole major version which typically means somewhere there are breaking changes. Did you just bump the JS @Deek9399 ?

patricoferris avatar Apr 15 '21 17:04 patricoferris

Screenshot from 2021-04-15 22-55-08

@patricoferris This is the screenshot of index.html, while looking for the source of this error I tried browsing files, this error arises due to the script below the footer which has a CDN link for bootstrap. Earlier I made changes here only just to check if this fixes the error. Changing that link and adding a link for jquery worked. Also if I remove that script tag(link), there is no Uncaught TypeError in the console. But I am unable to find where this link is located in site , I would like to test it by making changes in the proper file. Let me know if I am getting it wrong.

Deek9399 avatar Apr 15 '21 18:04 Deek9399

The link (I think) you are looking for is https://github.com/ocaml/ocaml.org/blob/master/template/main.mpp#L99

I'm not sure we can just remove the javascript or bump the version without also trying to upgrade the bootstrap CSS to the same JS version. You can try it but I would think it breaks in quite subtle ways.

patricoferris avatar Apr 19 '21 16:04 patricoferris