Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSTDEP017] [FSTDEP018] How can I hide/solve these logs #966

Open
2 tasks done
fberrez opened this issue Nov 21, 2023 · 4 comments
Open
2 tasks done

[FSTDEP017] [FSTDEP018] How can I hide/solve these logs #966

fberrez opened this issue Nov 21, 2023 · 4 comments

Comments

@fberrez
Copy link

fberrez commented Nov 21, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

version fastify 4.24.3

I have this two logs that come regurlaly in my app:

(node:1) [FSTDEP017] FastifyDeprecation: You are accessing the deprecated "request.routerPath" property. Use "request.routeOptions.url" instead. Property "req.routerPath" will be removed in `fastify@5`.
(node:1) [FSTDEP018] FastifyDeprecation: You are accessing the deprecated "request.routerMethod" property. Use "request.routeOptions.method" instead. Property "req.routerMethod" will be removed in `fastify@5`

I have no idea about what I can do to solve or hide these logs since I don't use routerPath or routerMethod in my code.

@Uzlopak
Copy link

Uzlopak commented Nov 21, 2023

You need to check your dependencies and upgrade them accordningly.

Anyway you can disable the deprecation warnings as documented:

https://github.com/fastify/process-warning#suppressing-warnings

Moving this to fastify/help because it is no bug or anything regarding fastify.

@Uzlopak Uzlopak transferred this issue from fastify/fastify Nov 21, 2023
@kibertoad
Copy link
Member

@fberrez Are all of your plugins up-to-date? deprecation was fixed at least in all most popular ones already, so updating most likely will help

@fberrez
Copy link
Author

fberrez commented Nov 21, 2023

Actually I don't have any plugin in my project.
Here is my (simplified) code:

// fastify.js
const fastify = require('fastify')();
const router = require('./router');
fastify.register(router)
// router.js
module.exports = (server, opts, next) => {
  server.get('/healthcheck', async () => {
    return {
      model_version_status: [
        {
          version: '1.0.0',
          state: 'AVAILABLE',
          status: {
            error_code: 'OK',
            error_message: '',
          },
        },
      ],
    };
  });
  next();
};

And I have the logs everytime I request GET /healthcheck.

Thank you for the options to disable the warnings @Uzlopak, I'm going to use this for now.

@mcollina
Copy link
Member

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants