-
Notifications
You must be signed in to change notification settings - Fork 90
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
Don't persist path error on startup for forever #14
Comments
If |
No |
This is a bug. I've written a little example 'use strict'
const fastify = require('fastify')()
const path = require('path')
fastify.register(require('./index'), {
root: path.join(__dirname, 'unexisting-folder')
})
fastify.listen(0, function (err) {
console.log(err)
}) And this script prints
Could you provide some context? |
NB: with 'use strict'
const fastify = require('fastify')()
const path = require('path')
fastify.register(require('./index'), {
root: path.join(__dirname, 'unexisting-folder')
}, err => {
console.log(err ? 'error' : '0') // <---- prints 'error'
})
fastify.listen(0, function (err) {
console.log(err) // <--- err is undefined!
}) |
Look at example 3 in issue fastify/fastify#391 |
Fixed in fastify 0.30.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I initialize
fastify-plugin
in folder/static
and the path does not exists 404 error is thrown. When I create the folder/static
after that the error still persists and the user doesn't know what's going on. We don't have to persist that error the path is already checked bysend
module and can be handled by the error events.btw: Isn't possible to use
serve-static
as middleware ?The text was updated successfully, but these errors were encountered: