Swagger not working on Vercel hosted Express API
swagger-ui-bundle.js:3 Uncaught SyntaxError: Unexpected token ‘<‘ (at swagger-ui-bundle.js:3:1)
swagger-ui-standalone-preset.js:3 Uncaught SyntaxError: Unexpected token ‘<‘ (at swagger-ui-standalone-preset.js:3:1)
swagger-ui-init.js:658 Uncaught ReferenceError: SwaggerUIBundle is not defined
at window.onload (swagger-ui-init.js:658:7)
For some reason at production I am getting this error when I hit the /api-docs route. I’ve looked through many other guys sharing their problem with customCssUrl and etc. but nothing worked for me.
If anyone has any clue why swagger does not work on production (vercel) please share what could be the problem here.