question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add support for fastify@4

See original GitHub issue

Currently fastify v4 has RC pre-releases. Our TAV tests and supported-technologies doc page say we support fastify >=1. We should change that to be specific about the major versions support, and we should test and update for fastify v4 as necessary.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
trentmcommented, Jun 9, 2022

fastify@4 requires node >=14.6.0 – because it uses pino@8 which uses on-exit-leak-free@1 which requires https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry which came in node 14.6.0.

0reactions
trentmcommented, Nov 15, 2022

@karliell

When I run this:

const fastify = require('fastify')
const app = fastify()
app.get('/ping', (req, reply) => {
    reply.send('pong')
})
app.listen({ port: 3000 }, (err) => { if (err) throw err }, () => {
    console.log("running on port 3000");
});

I see that FSTDEP011 warning:

(node:73658) [FSTDEP011] FastifyDeprecation: Variadic listen method is deprecated. Please use ".listen(optionsObject)" instead. The variadic signature will be removed in `fastify@5`.

However, when I run this:

const fastify = require('fastify')
const app = fastify()
app.get('/ping', (req, reply) => {
    reply.send('pong')
})
app.listen({port: 3000}, () => {
    console.log("running on port 3000");
});

I do not see that deprecation warning. I get the same behaviour whether or not the elastic-apm-node APM agent is being used.

Do you see different behaviour? I’m using fastify@4.9.2 and elastic-apm-node@3.40.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugins - Fastify
Plugins. Fastify allows the user to extend its functionalities with plugins. A plugin can be a set of routes, a server decorator, or...
Read more >
Updating your Node apps for Fastify 4 - Glitch Help Center
Update Fastify. In the package.json ADD PACKAGE dropdown, select the updated version of the Fastify package (it should be 4+).
Read more >
Facing unexpected tokken '?' error in fastify 4 - node.js
As wrote in the Fastify LTS statement, fastify v4 support Node.js >= 14. That said, the fastify codebase uses nullish operator ?? and...
Read more >
Announcing Fastify v4 release candidate! - Medium
We now support only Node.js v14+, and have fixed some bugs which ... URL decoding https://github.com/delvedor/find-my-way/pull/207; Added ...
Read more >
fastify-metrics - npm
This plugin also adds two http metrics for your routes: ... x.x - supports fastify-4.x prom-client-14.x ... Support disabling metrics in route config....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found