809 questions
2
votes
0
answers
98
views
how to use fastify accept application/json no body
curl --request POST 'http://127.0.0.1:3000/' --header 'Content-Type: application/json;'
response
Body cannot be empty when content-type is set to 'application/json'
import { NestFactory } from '@...
0
votes
1
answer
152
views
Node.js Docker container crashes: Error: Cannot find addon '.' imported from sodium-native
I’m trying to run my Node.js app inside Docker on intel macbook, but it crashes at startup with the following error:
Error: Cannot find addon ‘.’ imported from ‘file:///app/node_modules/sodium-native/...
0
votes
0
answers
56
views
Cpanel shared Nodejs hosting GLIBC_2.29 not found
I am developing an app using fastify 5.6 & better-sqlite3 - 12.2.0
all is well and better-sqlite3 speed is phenomenal. The development was done in Windows 11 machine.
I am trying to host this in a ...
0
votes
1
answer
101
views
`async` test of a Fastify backend with `@fastify/websocket` times out, but also finishes
I'm trying to test (using Vitest) a part of my Fastify app that uses @fastify/websocket (and transitively ws), but my tests keep timing out despite running to completion. Here's a relevant excerpt ...
0
votes
0
answers
139
views
Problem with @fastify/multipart and fastify-type-provider-zod
the schema validation does not work in this example because the file is converted to Buffer when the attachFieldsToBody: “keyValues” parameter is set in the @fastify/multipart config, but I need it to ...
1
vote
0
answers
76
views
How can I load a remote module from a Module Federation app during SSR (Fastify) and extract its JS/CSS chunks?
I'm building a prototype to test Server-Side Rendering (SSR) with Webpack Module Federation (WMF) in our large app. I have two apps:
App 1 – Remote App (React + Webpack)
Basic Button1 component:
const ...
0
votes
0
answers
46
views
How to pass controller class instance to Fastify routing?
I'm trying to pass an instance of a controller class to Fastify routing, but Fastify only calls the method "login", the constructor is not called
const userController = container.get<...
1
vote
0
answers
20
views
Node Fastify plugin registration [duplicate]
Fastify allows registering plugins against a Fastify instance.
One way of doing that is:
import Fastify from 'fastify';
import cors from '@fastify/cors';
const fastify = Fastify();
await fastify....
0
votes
0
answers
61
views
fastify ajv validation throw error on anyOf
I have a simple schema for data validation like below, when sending an array for packages with length 1 it throw an error for anyOf, and for more than one. it's ok and work currectly.
I've try to ...
0
votes
0
answers
179
views
How should I handle the proxy protocol in a Fastify server?
Nginx config:
stream {
map $ssl_preread_server_name $backend_upstream {
api.xxx.com backend_1;
}
upstream backend_1 {
server 127.0.0.1:4433;
}
server {
...
1
vote
1
answer
33
views
FastifyAdapter bypasses global ValidationPipe for tz, resulting in 400 whitelistValidation error in production builds
FastifyAdapter bypasses global ValidationPipe for tz, resulting in 400 whitelistValidation error in production builds
Description
I’m experiencing an issue where my global ValidationPipe is correctly ...
1
vote
0
answers
260
views
How to include additionalField in return to better-auth
I'm trying to add a role field to user schema. It worked as I can see it on the database but it doesn't get returned when I call any api endpoints
export const auth = betterAuth({
database: pool,
...
1
vote
1
answer
104
views
Pino logger timezone is not lined up with system timezone
There is Fastify app with pino logger on AlmaLinux 9.2 using pm2.
$ timedatectl:
Local time: Mon 2025-06-09 22:23:54 +05
Universal time: Mon 2025-06-09 17:23:54 UTC
RTC time: Mon 2025-06-09 17:23:...
0
votes
1
answer
78
views
Why fastify/view can't find the .view method?
I try to use @fastify/view with TS and i'm getting an error:
{"statusCode":500,"error":"Internal Server Error","message":"res.view is not a function"}
...
2
votes
1
answer
318
views
How to avoid losing Zod type provider generic with Fastify AutoLoad
I'm using Fastify with the fastify-type-provider-zod plugin:
const fastify = Fastify().withTypeProvider<ZodTypeProvider>();
And the fastify-autoload plugin:
// This loads all plugins defined in ...