Vanilla-IceCream / fastify-uws

A performant HTTP and WebSocket server for Fastify with uWebSockets.
MIT License
18 stars 1 forks source link

The server does not start after update to fastify v4.28.1 #1

Closed pasha-vuiko closed 3 months ago

pasha-vuiko commented 4 months ago

The server does not start after update to fastify v4.28.1, previously worked fine. The server just being freezed on call of .listen()

Shyam-Chen commented 4 months ago

I cannot reproduce your issue; I am using Node.js v20.

Ref: https://github.com/Shyam-Chen/Fastify-Starter/blob/main/app/package.json#L33


Updated:

Downgraded to version 4.28.0

pasha-vuiko commented 4 months ago

Hmm, interesting, let me check again

pasha-vuiko commented 4 months ago

Still have the issue, previously tried with nestjs-platform-fastify, now tried with pure fastify:

import fastify from "fastify";
import { serverFactory } from "fastify-uws";

const app = fastify({
  serverFactory,
});

app.get("/", async (request, reply) => {
  const hello = 'hello';

  return { hello: hello };
});

app
  .listen({
    host: "0.0.0.0",
    port: 3000,
  })
  .then((address) => {
    console.log(`server listening on ${address}`);
  });

the issue is still the same, the server just not starting.

I'm using MacOS 14.5 and Node.js v20.15.0

Shyam-Chen commented 4 months ago

listen works, but .then() cannot be executed.

The changes affect listen in version 4.28.1: https://github.com/fastify/fastify/pull/5523/files#diff-1b48bb429de959672dadab9c87c215e19177dd70e3bd932d131ce74294c44cd5


Upstream Issue Tracking: https://github.com/geut/fastify-uws/issues/6

Shyam-Chen commented 3 months ago

Released in fastify-uws version 0.8, incorporating some upstream code.


 ~/Documents/Fastify-Starter/ [main] pnpm dev

> @ dev /Users/shyam.chen/Documents/Fastify-Starter
> pnpm -C app dev

> @ dev /Users/shyam.chen/Documents/Fastify-Starter/app
> vite-node -w src/main.ts

2024-07-16 17:19:54.367+0800 - info - Server listening at http://127.0.0.1:3000