DEV Community

SomervilleTom
SomervilleTom

Posted on

No deployment to HTTPS?

ANY production-ready web service must support HTTPS.

Surely it is not controversial to assert that it should be easy for "deployment" -- as in yarn build, for example, -- to result in a service that uses HTTPS (as opposed HTTP) on the designated port. Now that CRA is dead, I find no practical way to accomplish this using React.

The stance taken by the official React documentation is misleading at at best:

Next.js is maintained by Vercel. You can deploy a Next.js app to any Node.js or serverless hosting, or to your own server. Fully static Next.js apps can be deployed to any static hosting.

I've spent the last few days trying to make the simple out-of-the-box create-next-app from next.js run on https. So far as I can tell, according to the next.js site and its several online communities, the only way to support https is to host the site on vercel.

That is unacceptable.

For all its flaws, the approach used by CRA was elegant and worked. All that was needed was to run yarn build and point a properly configured httpd (I use Apache) service at the resulting build directory.

While it is possible to do a "static" build this way, that results in significant loss of needed behavior.

I understand why CRA was deprecated. I am disappointed that the alternatives for replacing it do not apparently include an approach that provides https support comparable to CRA.

Top comments (0)