Gatsby: Mixed content errors when using HTTPS option with dev server

Created on 5 Oct 2020  路  1Comment  路  Source: gatsbyjs/gatsby

the fix:
https://github.com/gatsbyjs/gatsby/blob/67615bf95cd802cc4a430ea6917892a87bebe7d4/packages/gatsby/cache-dir/app.js#L37-L39
should be

const parentSocket = io(
`${window.location.protocol}//${window.location.hostname}:${window.location.port}`
)

(it should use the protocol instead of only http://)

These sort of errors started happening for me when I used gatsby develop --host my.example.com --port 8443 --https
I'm not using Netlify; not a problem on their end.

bug introduced from
https://github.com/gatsbyjs/gatsby/pull/24335 (particularly https://github.com/gatsbyjs/gatsby/pull/24335/commits/a7f92af27526040ed15012ea50465f373606d8b5)

possibly related issues:
https://github.com/gatsbyjs/gatsby/issues/24864 (cors)
https://github.com/gatsbyjs/gatsby/issues/25570 (cors)
https://github.com/netlify/cli/issues/981 (netlify mixed content)

_Originally posted by @jonathanstanley in https://github.com/gatsbyjs/gatsby/issues/25695#issuecomment-687983024_

bug

Most helpful comment

This issue was brought up in a closed issue by @jonathanstanley, I thought I deserved it's own separate issue.

>All comments

This issue was brought up in a closed issue by @jonathanstanley, I thought I deserved it's own separate issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KyleAMathews picture KyleAMathews  路  3Comments

benstr picture benstr  路  3Comments

theduke picture theduke  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

totsteps picture totsteps  路  3Comments