cloudflare / cloudflare/workerd
🐛 Bug Report — Runtime APIs - Fastify support
- 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
Assessment
This issue has not been assessed yet.