You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I encountered an issue where the adonis-autoswagger package stops rendering the Swagger UI after integrating Vite into my AdonisJS v6 project. Before adding Vite, everything was working perfectly, but after installation and configuration, accessing /docs/swagger results in a 404 Not Found error.
Steps to Reproduce
Install AdonisJS v6 and adonis-autoswagger.
Confirm that Swagger UI is accessible via /docs/swagger.
Install and configure Vite following the official AdonisJS documentation.
Try accessing /docs/swagger again.
Observe that the page is no longer accessible, and the API spec files (swagger.json, swagger.yml) seem to be inaccessible.
Expected Behavior
Swagger UI should continue to work even after integrating Vite, without breaking the ability to serve API documentation.
Current Behavior
/docs/swagger returns Cannot GET /docs/swagger.
Swagger JSON/YAML files are no longer accessible.
No clear errors related to adonis-autoswagger appear in the logs.
Workaround Attempts
Manually adding routes to serve swagger.json and swagger.yml did not fully resolve the issue.
Ensuring the vite middleware is loaded after core middlewares in start/kernel.ts.
However, Swagger UI still fails to load correctly.
Possible Cause
It seems that after enabling Vite, AdonisJS is no longer serving the swagger.json and swagger.yml files correctly. Vite might be interfering with static file serving, causing adonis-autoswagger to break.
Environment
AdonisJS Version: 6.x
adonis-autoswagger Version: (latest)
Vite Version: (latest)
Node.js Version: v22.13.0
Operating System: macOS
Request for Help
Could you provide guidance on how to properly configure adonis-autoswagger to work alongside Vite? Any recommendations on middleware configuration or alternative ways to serve Swagger UI would be highly appreciated.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Tbh, I haven't used Vite with adonisjs, and I'm not familiar how it intercepts with the routes.
Do any other routes work that return a simple JSON?
Something like GET /test and just return {"hello": "world"} If that doesn't work, then you have to dig through the AdonisJS docs to see what's going on.
No errors from adonis-autoswagger simply means that it isn't even loaded, which is obvious, because of 404
Description:
I encountered an issue where the
adonis-autoswagger
package stops rendering the Swagger UI after integrating Vite into my AdonisJS v6 project. Before adding Vite, everything was working perfectly, but after installation and configuration, accessing/docs/swagger
results in a404 Not Found
error.Steps to Reproduce
adonis-autoswagger
./docs/swagger
./docs/swagger
again.swagger.json
,swagger.yml
) seem to be inaccessible.Expected Behavior
Swagger UI should continue to work even after integrating Vite, without breaking the ability to serve API documentation.
Current Behavior
/docs/swagger
returnsCannot GET /docs/swagger
.adonis-autoswagger
appear in the logs.Workaround Attempts
swagger.json
andswagger.yml
did not fully resolve the issue.vite
middleware is loaded after core middlewares instart/kernel.ts
.proxy
rules invite.config.ts
:Possible Cause
It seems that after enabling Vite, AdonisJS is no longer serving the
swagger.json
andswagger.yml
files correctly. Vite might be interfering with static file serving, causingadonis-autoswagger
to break.Environment
AdonisJS Version: 6.x
adonis-autoswagger Version: (latest)
Vite Version: (latest)
Node.js Version: v22.13.0
Operating System: macOS
Request for Help
Could you provide guidance on how to properly configure
adonis-autoswagger
to work alongside Vite? Any recommendations on middleware configuration or alternative ways to serve Swagger UI would be highly appreciated.Thanks in advance!
The text was updated successfully, but these errors were encountered: