preact-cli: 'npm run serve' shows TLS error and the site is not running

npm run serve show me TLS error in the terminal and going to http://localhost:8080/ on chrome tells me “site can’t be reached”

Steps to reproduce:

preact create app --type full
cd app
npm run serve

Output:

> app@1.0.0 serve /tmp/app
> preact build && preact serve

Build [==================  ] 91% (2.5s) additional asset processing
  Total precache size is about 173 kB for 15 resources.

  Listening on https://localhost:8080...
  http: TLS handshake error from [::1]:46434: read tcp [::1]:8080->[::1]:46434: use of closed network connection
  http: TLS handshake error from [::1]:46436: read tcp [::1]:8080->[::1]:46436: use of closed network connection
  http: TLS handshake error from [::1]:46440: read tcp [::1]:8080->[::1]:46440: use of closed network connection
  http: TLS handshake error from [::1]:46552: read tcp [::1]:8080->[::1]:46552: use of closed network connection

More info:

  • Ubuntu 16.04
  • npm 5.0.0
  • node 7.7.4

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 27 (7 by maintainers)

Most upvoted comments

@oren Prerender !== server side rendering (SSR)

Prerender means using SSR technique to render your initial route at build time. When prerender is enabled, the users of your application will see the first meaningful paint faster. ==> better UX.

But you can safely run it with npm run build -- --no-prerender

@oren oh my fault. Typing this on the phone with out a IDE. It should be typeof window !== "undefined"

You can find preact-cli cert here. https://github.com/developit/preact-cli/tree/984476fb171e73a4224f304e7c127063266de8a8/src/resources

You can use it, or create your own certificates and run the server with it.

Some resources for you: