Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help to fix error "No operations found defined in spec" when deploying #4

Open
TanNguyen17112003 opened this issue Jun 22, 2024 · 1 comment

Comments

@TanNguyen17112003
Copy link

Hello Mr.Milan,

I'm building and deploying an application to Vercel with the following frameworks and libraries:

  • Express
  • Prisma
  • Swagger

During the building and deploying process, I have a mistake when deploying to vercel like that: I can't see any apis in swagger when deploying to vercel (this is my link: https://tsa-backend.vercel.app/docs/ ), but everthing works well when building in local. Afterwards, I research and try to fix this error following these steps:

  • Replace the order of swagger setup and route in main file
  • Config the "apis" in swagger option
  • Downgrade of swagger-express-ui to 4.6.2
    But the results are not different and I'm still having the same problem.

Could you help me realize and fix this error? This is my repo:
https://github.com/TanNguyen17112003/tsa-backend/

image
image

@Milan-960
Copy link
Owner

Hello Mr.Milan,

I'm building and deploying an application to Vercel with the following frameworks and libraries:

  • Express
  • Prisma
  • Swagger

During the building and deploying process, I have a mistake when deploying to vercel like that: I can't see any apis in swagger when deploying to vercel (this is my link: https://tsa-backend.vercel.app/docs/ ), but everthing works well when building in local. Afterwards, I research and try to fix this error following these steps:

  • Replace the order of swagger setup and route in main file
  • Config the "apis" in swagger option
  • Downgrade of swagger-express-ui to 4.6.2
    But the results are not different and I'm still having the same problem.

Could you help me realize and fix this error? This is my repo: https://github.com/TanNguyen17112003/tsa-backend/

image image

Hi TanNguyen17112003

have you tired to check the doc of the swagger? at some point, vercel does not suppot the cloud flare CNS style. maybe it would be good if you try to add the CND inside your main.ts or js file that you have in the root folder we you have declare the /docs routes for your API.

yeah exactly like this that you have here :) and it should be fine and should work. let me know how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants