fastify / fastify

Fast and low overhead web framework, for Node.js
https://www.fastify.dev
Other
32.19k stars 2.28k forks source link

5.0.0 - pnpm - Uncaught TypeError TypeError: diagnostics.tracingChannel is not a function #5708

Open gowy222 opened 3 weeks ago

gowy222 commented 3 weeks ago

Prerequisites

Fastify version

5.0.0

Plugin version

No response

Node.js version

v18.18.2

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

win11

Description

today > pnpm up > "fastify": "^5.0.0",

project type: CommonJS

  "dependencies": {
    "@fastify/compress": "^8.0.1",
    "@fastify/cookie": "^10.0.1",
    "@fastify/jwt": "^9.0.1",
    "@fastify/static": "^8.0.1",
    "fastify": "^5.0.0",

Uncaught TypeError TypeError: diagnostics.tracingChannel is not a function
    at <anonymous> (d:\mycode\app_entry\node_modules\.pnpm\fastify@5.0.0\node_modules\fastify\lib\wrapThenable.js:9:30)
    at Module._compile (internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (internal/modules/cjs/loader:1310:10)
    at Module.load (internal/modules/cjs/loader:1119:32)
    at Module._load (internal/modules/cjs/loader:960:12)
    at Module.require (internal/modules/cjs/loader:1143:19)
    at require (internal/modules/cjs/helpers:119:18)

Link to code that reproduces the bug

No response

Expected Behavior

No response

mcollina commented 3 weeks ago

As noted in the migration guide, Node.js v20+ is now required.

jonasesser commented 1 week ago

I have the same issue with node v22.8.0. Any solutions?

mcollina commented 1 week ago

Please upload a reproduction, as that's kind of impossible.

climba03003 commented 1 week ago

I will close this week in the end of this week, I don't think node@22.8.0 is missing tracingChannel. This feature is added in node@18.19.0.

If you are using docker please double check the base image you are using. If you use node version switch (e.g. nvm), please double check the current selected node version. If you install multiple node in your system, please double check the current using node version.

You can simply log the process.version inside your application to verify the node version you are using.

gowy222 commented 6 days ago

Updating nodejs to 20+ LTS (fro now v20.9.0) fixed the issue, THX!

@climba03003 You chose to close this issue later because it seems that others haven't solved it yet :p