fastify / fastify-swagger-ui

Serve Swagger-UI for Fastify
MIT License
132 stars 40 forks source link

Sometimes the plugin crashes the entire app without returning any error #102

Closed maximelafarie closed 9 months ago

maximelafarie commented 9 months ago

Prerequisites

Fastify version

4.23.2

Plugin version

1.10.1

Node.js version

20

Operating system

macOS

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

14.1.1

Description

At startup (or if the app is rebuilt with an error into doc specs), the app crashes immediately without any error message. I know it's a problem with the documentation specs (because if I comment the related schema the error disappears) but I'd like the error to tell me where it is and don't crash the entire app.

Is there any way I can catch the swagger-ui error if there is one? I didn't see any related option in the plugin params.

Steps to Reproduce

Make an error in your documentation specs. npm start your node app.

Expected Behavior

Either don't suddenly kill the app or at least provide a consistent error message.

maximelafarie commented 9 months ago

not related to this plugin