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

Playground fails to connect to server on Safari when connecting via localhost #1416

Open
1 of 7 tasks
ArmandAgopian opened this issue Feb 12, 2023 · 1 comment
Open
1 of 7 tasks

Comments

@ArmandAgopian
Copy link

ArmandAgopian commented Feb 12, 2023

This issue pertains to the following package(s):

  • GraphQL Playground - Electron App
  • GraphQL Playground HTML
  • GraphQL Playground
  • GraphQL Playground Express Middleware
  • GraphQL Playground Hapi Middleware
  • GraphQL Playground Koa Middleware
  • GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

macOS 13.2, Safari 16.3 (18614.4.6.1.5)

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

express middleware 1.7.23

What is the expected behavior?

Playground can be reached via localhost and make queries/check schema

What is the actual behavior?

Playground loads fine, but can't connect to server. Error below. This does not happen when connecting via 127.0.0.1

What steps may we take to reproduce the behavior?

Connect to Playground via localhost on Safari

Please provide a g
Screenshot 2023-02-11 at 9 20 54 PM
if or image of the issue for a quicker response/fix.

@strefethen
Copy link

This sounds like an issue I've run into too. My problem is that render-playground-page.js uses URLs without specifying the protocol and fetches using "http" vs. "https" fail.

Note, until/unless this is fixed in the repo you will have to make this change every time you delete node_modules or reinstall all packages and overwrite your manual change.

In the following code change the URL after "void 0 ? ' from '//cdn.jsdelivr..' to 'https://cdn.jsdelivr...'

var getCdnMarkup = function (_a) {
    var version = _a.version, _b = _a.cdnUrl, cdnUrl = _b === void 0 ? 'https://cdn.jsdelivr.net/npm' : _b, faviconUrl = _a.faviconUrl;
    var buildCDNUrl = function (packageName, suffix) { return filter(cdnUrl + "/" + packageName + (version ? "@" + version : '') + "/" + suffix || ''); };
    return "\n    <link\n      rel=\"stylesheet\"\n      href=\"" + buildCDNUrl(reactPackageName, 'build/static/css/index.css') + "\"\n    />\n    " + (typeof faviconUrl === 'string' ? "<link rel=\"shortcut icon\" href=\"" + filter(faviconUrl || '') + "\" />" : '') + "\n    " + (faviconUrl === undefined ? "<link rel=\"shortcut icon\" href=\"" + buildCDNUrl(reactPackageName, 'build/favicon.png') + "\" />" : '') + "\n    <script\n      src=\"" + buildCDNUrl(reactPackageName, 'build/static/js/middleware.js') + "\"\n    ></script>\n";
};

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