Skip to content

async style not supported #110

@markrzen

Description

@markrzen

🐛 Bug Report

When async style is used, undefined promise error is always logged.
Originally filed in as help issue 106

To Reproduce

Steps to reproduce the behavior:

Change the example in in project to use async and watch logs.

'use strict';

const path = require('path');
const fastify = require('fastify')({ logger: { level: 'trace' } });

fastify
  .register(require('../'), { root: path.join(__dirname, '/public') })
  .get('/', async (request, reply) => {
    reply.sendFile('index.css');
  });

fastify.listen(3000, err => {
  if (err) throw err;
});

Expected behavior

No promise undefined error to be logged as per Promise resolution documentation.

Your Environment

  • node version: 12.7.0
  • fastify version: 2.8.0
  • os: Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions