swagger-spec-express icon indicating copy to clipboard operation
swagger-spec-express copied to clipboard

express 5 compliance error

Open SSANSH opened this issue 9 months ago • 0 comments

swagger-spec-express package is not compliant with express 5

I have the following error when I try to bump express from 4 to 5

Error: app._router was null, either your app is not an express app, or you have called compile before adding at least one route

I think this was due to

https://expressjs.com/en/guide/migrating-5.html

app.router The app.router object, which was removed in Express 4, has made a comeback in Express 5. In the new version, this object is a just a reference to the base Express router, unlike in Express 3, where an app had to explicitly load it.

_router is not available, its a getter now.

Can you please check it?

SSANSH avatar Apr 29 '25 07:04 SSANSH