asyncapi / studio

Visually design your AsyncAPI files and event-driven architecture.
https://studio.asyncapi.com
Apache License 2.0
170 stars 100 forks source link

Generating code/docs results in error #1144

Open haukepauke opened 3 weeks ago

haukepauke commented 3 weeks ago

Describe the bug

When trying to generate a "HTML website" or "Markdown documentation" for the default project "Streetlights Kafka API 1.0.0" or any other project file an error message is shown: "Failed to generate."

This behaviour is similar for the version running on https:/studio.asyncapi.com and on a checkout of the master branch, running it locally (localhost:3000).

Browser console shows the error:

POST http://localhost:3001/api/v1/generate net::ERR_CONNECTION_REFUSED (Chromium, Version 129.0.6668.70, Linux, 64 Bit)

Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf http://localhost:3001/api/v1/generate. (Grund: CORS-Anfrage schlug fehl). Statuscode: (Firefox, 130.0.1, Linux, 64-Bit).

How to Reproduce

  1. Open studio.asyncapi.com
  2. Click on the three dots in the upper right corner, choose "generate code/docs"
  3. Pick f.e. "Markdown documentation", click "Generate"

grafik

Expected behavior

There should be no error message. Documentation should be generated.

github-actions[bot] commented 3 weeks ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

catosaurusrex2003 commented 3 weeks ago

@aeworxet Please review my changes related to this line in the above PR

aeworxet commented 3 weeks ago

@catosaurusrex2003

Situation with generator and server-api is complicated in general:

https://github.com/asyncapi/studio/pull/1094#issuecomment-2120038356

we should remove the dependency with https://github.com/asyncapi/server-api in the NextJS version of studio as this repository might be deprecated soon.

https://github.com/asyncapi/studio/pull/1094#issuecomment-2134983109

KhudaDad414 suggests the opposite, to stick with server-api.

https://github.com/asyncapi/studio/issues/661#issuecomment-2163496500

Investigaton that showed that the server's part will at some point MAYBE migrate to CLI. Maybe not.

So there is no a one-byte solution to this issue currently.

@Amzani, can you please share what the current thoughts are on generator and server-api (I see that https://github.com/asyncapi/studio/issues/1110 is in the backlog of https://github.com/orgs/asyncapi/projects/39, but it's a bit stalled?)

Maybe someone else should be tagged in this issue also?

Amzani commented 3 weeks ago

@aeworxet server-api is not working anyway with v3, so I suggest to directly support generator it in studio. cc @Shurtu-gal / @KhudaDad414

Shurtu-gal commented 3 weeks ago

@aeworxet server-api is not working anyway with v3, so I suggest to directly support generator it in studio. cc @Shurtu-gal / @KhudaDad414

Yeah this is the natural next step.