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

https mode not working due to missing WDS option #3301

Closed
mattmillerart opened this issue Aug 18, 2020 · 5 comments · Fixed by #3311
Closed

https mode not working due to missing WDS option #3301

mattmillerart opened this issue Aug 18, 2020 · 5 comments · Fixed by #3311
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.

Comments

@mattmillerart
Copy link

🐛 Bug Report

According to the docs (actually, not sure if this is in the docs) setting process.env.HTTPS=true should start webpack dev server in https mode. This does not work because a missing option in the webpack dev server config.

Here is the webpack dev server docs showing the https option: https://webpack.js.org/configuration/dev-server/#devserverhttps

Here is the Docusaurus config which does not use this option: https://github.com/facebook/docusaurus/blob/master/packages/docusaurus/src/commands/start.ts#L131-L132

Adding this line I was able to get it working as expected

https: process.env.HTTPS === 'true',

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

  1. Create new docs from 2.0.0-alpha.61
  2. Modify yarn start to be HTTPS=true yarn start
  3. Notice the browser opens the expected https https://localhost:3000/ but the page does not load.
  4. Notice the console logs http in 「wds」: Project is running at http://localhost:3000/

Expected behavior

Https opens AND site is running on https.

Actual Behavior

Https opens BUT site is running on http

Your Environment

  • Docusaurus version used: Using 2.0.0-alpha.61
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Chrome, Mac, Node 12
  • Operating system and version (desktop or mobile): Desktop

Reproducible Demo

The issue is simple enough I don't believe it warrants a demo. The steps to reproduce are minimal and include spinning up a new project and running a yarn command. If the team still believes a demo is needed or can't repro the issue I can provide one.

@mattmillerart mattmillerart added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 18, 2020
@facultymatt
Copy link

Related, Docusaurus should probably mirror the options of CRA for setting custom certs: https://create-react-app.dev/docs/using-https-in-development/ to keep things consistent

@slorber
Copy link
Collaborator

slorber commented Aug 18, 2020

Thanks, agree we should fix that.

Someone willing to submit a PR?

@slorber slorber added good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR. mlh Major League Hacking Fellowship and removed bug An error in the Docusaurus core causing instability or issues with its execution labels Aug 18, 2020
@arcvats
Copy link
Contributor

arcvats commented Aug 19, 2020

Can I take this one?

@slorber
Copy link
Collaborator

slorber commented Aug 20, 2020

yes thanks ;)

@facultymatt
Copy link

Thanks for the fix! Opened a new issue as suggested for the custom cert config: #3445

@Josh-Cena Josh-Cena added bug An error in the Docusaurus core causing instability or issues with its execution and removed status: needs triage This issue has not been triaged by maintainers mlh Major League Hacking Fellowship labels Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants