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

Unable to get HMR/ HDR for HTTPS express server - Could not reach Remix dev server at https://localhost:3001 #6402

Closed
1 task done
cliffordfajardo opened this issue May 16, 2023 · 5 comments · Fixed by #6483

Comments

@cliffordfajardo
Copy link
Contributor

cliffordfajardo commented May 16, 2023

What version of Remix are you using?

1.16.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Example repo of a new Remix Express app using HTTPS: https://github.com/cliffordfajardo/remix-express-https-hmr/tree/main

1. Install dependencies

npm i

2. Generate self-signed certs

Since we intend on using HTTPs, we need to create self-signed certificates.
After running the command below, you will be prompted to give answers to the openssl CLI tool that generates the cert server.key and server.cert file.

npm run gen-cert

# For details see this small blog post:  https://flaviocopes.com/express-https-self-signed-certificate/

3. Start the remix app

## NOTE: you will be prompted to fill in a few values from openssl CLI tool. See: https://flaviocopes.com/express-https-self-signed-certificate/
npm run dev

Expected Behavior

The dev server should be reachable via HTTPS when passing https settings inside of remix.config.js
See sample repo: https://github.com/cliffordfajardo/remix-express-https-

/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
  ignoredRouteFiles: ["**/.*"],
  // appDirectory: "app",
  // assetsBuildDirectory: "public/build",
  // serverBuildPath: "build/index.js",
  // publicPath: "/build/",
  // serverModuleFormat: "cjs",
  serverModuleFormat: "cjs",
  future: {
    unstable_dev: {
      httpScheme: 'https',
      httpHost: 'localhost',
      port: 15001,
    },
    v2_errorBoundary: true,
    v2_meta: true,
    v2_normalizeFormMethod: true,
    v2_routeConvention: true,
  },
};

Actual Behavior

> remix dev --no-restart -c "node server.js"

💿 Building...
💿 Built in 609ms
Waiting for app server (52766818)
> node server.js
Remix dev server ready
Express server listening https://localhost:15001
❌ Could not reach Remix dev server at https://localhost:3001

edit* -- Related References

@cliffordfajardo
Copy link
Contributor Author

cliffordfajardo commented May 16, 2023

Hey @pcattori,
I tried following the express unstable_dev-enabled template referenced in the 1.16.0 release notes here:
https://github.com/remix-run/remix/releases/tag/remix%401.16.0

Most likely I'm not passing the right settings in remix.config.js? 😅

Once I'm able to get this working, I want to create a similar, new repo, so other folks wanting to use HMR/HDR with their HTTPS remix-express can benefit; I can post it in Remix Repo's Discussion's Show and Tell section so other folks using HTTPS can benefit 🙌

let me know how I can help 🙏

@cliffordfajardo cliffordfajardo changed the title Remix Express app: HMR/ HDR for HTTPS based server Remix Express app: HMR/ HDR for HTTPS based server - Could not reach Remix dev server at https://localhost:3001 May 16, 2023
@cliffordfajardo cliffordfajardo changed the title Remix Express app: HMR/ HDR for HTTPS based server - Could not reach Remix dev server at https://localhost:3001 Unable to get HMR/ HDR for HTTPS express server - Could not reach Remix dev server at https://localhost:3001 May 16, 2023
@pcattori
Copy link
Contributor

Right now SSL / HTTPS is possible, but its tedious and error-prone. Luckily, proper SSL / HTTPS support is coming soon.

You can see https://github.com/atsolberg/compiled-remix-1.16.0/pull/1/files for how to patch Remix in the short-term, but expect out-of-the-box support for https to come before v2.

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-21504cf-20230526 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

🤖 Hello there,

We just published version 1.17.0-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

🤖 Hello there,

We just published version 1.17.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants