Welcome to the Linux Foundation Forum!

FST_ERR_PROMISE_NOT_FULFILLED

In Chapter 5 I got an error like the this:

{
"err": {
"type": "FastifyError",
"message": "Promise may not be fulfilled with 'undefined' when statusCode is not 204",
"stack": "FastifyError: Promise may not be fulfilled with 'undefined' when statusCode is not 204\n at path/node_modules/fastify/lib/wrapThenable.js:30:30\n at processTicksAndRejections (node:internal/process/task_queues:94:5)",
"name": "FastifyError",
"code": "FST_ERR_PROMISE_NOT_FULFILLED",
"statusCode": 500
}
}

It returns the data but it shows that error in console.

Somebody have any idea of could be?

Answers

  • ferjpi
    ferjpi Posts: 2

    I see what was my error. I have an async function but I wasn't waiting for the reply to finished. I haven't realize the initial example was sync

  • well done for figuring it out @ferjpi

This discussion has been closed.

Categories

Upcoming Training