gbif / tech-docs

This is an integrated technical documentation site for GBIF.org
https://techdocs.gbif.org
0 stars 3 forks source link

Cannot load page in Safari Version 16.6 #59

Closed ManonGros closed 10 months ago

ManonGros commented 1 year ago

Feedback on Occurrence API (Github source for this page)

I have been trying to check the content of this https://tech-docs.gbif-uat.org/en/openapi/v1/occurrence#/Searching%20occurrences/searchOccurrence but I get a loading icon forever and no content. When I try it in Chrome, it works instantaneously.

MortenHofft commented 1 year ago

I can reproduce this. I get this error message in the console

[Error] TypeError: null is not an object (evaluating 'findReact(schemeSelect).setScheme')
    onComplete (occurrence:251)
[Error] TypeError: Right side of assignment cannot be destructured — swagger-ui-bundle.js:7:18814
    (anonymous function) (swagger-ui-bundle.js:7:19978)
[Error] Unhandled Promise Rejection: TypeError: Right side of assignment cannot be destructured
    (anonymous function) (swagger-ui-bundle.js:7:18814)
[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'n.resultMap')
    (anonymous function) (swagger-ui-bundle.js:7:20010)

So this in the occurrence file

onComplete: function() {
        var schemeSelect = document.querySelector('.scheme-container select');
        findReact(schemeSelect).setScheme('https');
      },
MattBlissett commented 1 year ago

Do you know how to fix it?

The code is very similar to what you wrote for the site originally, but I moved it here: https://github.com/gbif/tech-docs-theme/blob/main/src/partials/swagger-ui.hbs

The Jenkins build for tech-docs-theme triggers a build for tech-docs.

MortenHofft commented 1 year ago

I have no recollection of writing that. The 3-4 demos I made was no doubt just copy-pasted from the documentation/tutorial.

ahahn-gbif commented 10 months ago

This is marked as relevant to the launch, but I would not know how to fix. @MattBlissett, @MortenHofft, @ManonGros: how serious is this, would it be a blocking issue, and is it still the case (not a Safari user here)?

ManonGros commented 10 months ago

I would love if it could be fixed (I am sure I am not the only safari user out there) but it might not be a blocking issue?

MattBlissett commented 10 months ago

It is in the milestone as a launch issue, and assuming it still doesn't work in Safari that's a blocking issue.

thomasstjerne commented 10 months ago

Maybe try this:

onComplete: function() {
        var schemeSelect = document.querySelector('.scheme-container select');
        var selector = findReact(schemeSelect);
        if(selector){
           selector.setScheme('https');
        }
      },