When I use Fastify in combination with Swagger, the API documentation can not be accessed when running the bundle file by esbuild.
When I run the bundle file, I can see this error in the console:
"root" path "[path to one level above the project folder]/static" must exist
Trying to access the API documentation at http://localhost:3000/documentation then fails with a 404 HTTP error. The documentation thing when I run the unbundled code project.
My guess is that the code in the bundle somehow infers with the @fastify/swagger dynamic documentation generation so that the output path for the Swagger documentation HTML page is incorrect.
You can easily reproduce the issue in this project (further instructions given): https://github.com/MatsG23/esbuild-issue
When I use Fastify in combination with Swagger, the API documentation can not be accessed when running the bundle file by esbuild.
When I run the bundle file, I can see this error in the console:
Trying to access the API documentation at
http://localhost:3000/documentationthen fails with a 404 HTTP error. The documentation thing when I run the unbundled code project.My guess is that the code in the bundle somehow infers with the
@fastify/swaggerdynamic documentation generation so that the output path for the Swagger documentation HTML page is incorrect.You can easily reproduce the issue in this project (further instructions given): https://github.com/MatsG23/esbuild-issue