cloudflare / cloudflare/workerd

🐛 Bug Report — Runtime APIs - Fastify support

Open
#5,087 1 comment 2 reactions 0 assignees View on GitHub
feature request
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

Fastify has a few issues running with the HTTP APIs.

I cross posted here, I'm not sure where the issue lies.

https://github.com/fastify/fastify/issues/6314

Essentially:

When running the example code below (from Cloudflare's Express example, but replaced with Fastify) there are some issues:

`Uncaught TypeError: Cannot destructure property 'serializersSym' of 'pino.symbols' as it is undefined.`

I had to disable logging to make that one go away. But then:

`Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope.`

```
import { httpServerHandler } from 'cloudflare:node';

const fastify = require('fastify')({
logger: true
})

fastify.get('/', (request, reply) => {
reply.send({ hello: 'world' })
})

fastify.listen({ port: 3000 }, (err, address) => {
if (err) throw err
})

export default httpServerHandler({ port: 3000 });
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.