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

Renders empty HTML #989

Closed
henhal opened this issue Nov 13, 2023 · 5 comments
Closed

Renders empty HTML #989

henhal opened this issue Nov 13, 2023 · 5 comments
Labels

Comments

@henhal
Copy link

henhal commented Nov 13, 2023

Describe the bug

I installed AsyncAPI today to render some HTML from my spec, and have run into nothing but problems.

At first I tried using npx to invoke it:

$ npx asyncapi generate fromTemplate api/asyncapi.yml @asyncapi/html-template -o ./out

This returns without any errors, but nothing happens. Nothing at all.

I then, reluctantly, installed asyncapi globally using npm i -g and gave it another try.

$ asyncapi generate fromTemplate api/asyncapi.yml @asyncapi/html-template -o ./out

This processes my spec for a while, then announces that my HTML is found at ./out. And yes, there's an index.html and some js, but the rendered HTML is completely blank. An empty, white page.

So I went to the only AsyncAPI studio and validated my spec, and yes, it's valid - and HTML is rendered properly in the sidebar.

Obviously I'm doing something wrong, but in that case documentation is clearly not sufficient. I followed the instructions to install and render HTML from a very simple spec, and the output is void.

I also tried your own hello example with same results.

To Reproduce

Steps to reproduce the behavior:

  1. Create a simple hello world document
  2. Install asyncapi
  3. Attempt to render from the HTML template
  4. Observe the blank HTML output

Expected behavior

The rendered HTML should not be, ehrm, empty.

Sample document

asyncapi: 2.6.0
info:
  title: Hello world application
  version: '0.1.0'
channels:
  hello:
    publish:
      message:
        payload:
          type: string
          pattern: '^hello .+$'
Copy link

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.

@henhal
Copy link
Author

henhal commented Nov 13, 2023

Ok so it seems this is related to the 1.0.0 release of template-html:
See this issue:
asyncapi/html-template#456

If using @asyncapi/[email protected], it works.

The npx problem still stands, though.

@grudelsud
Copy link

grudelsud commented Nov 14, 2023

same here, had an empty output after validating the yaml with the online studio tool

specifying template version fixes the problem, the following command produces a working single html:

asyncapi generate fromTemplate ./docs/sqs/sqs_docs.yaml @asyncapi/[email protected] --param singleFile=true -o ./docs/sqs --force-write

for debug purposes, this is my output from asyncapi --version

@asyncapi/cli/0.60.0 darwin-x64 node-v21.1.0

@jonaslagoni
Copy link
Member

Lets close this issue and continue in asyncapi/html-template#456 as this has nothing to do with the spec :)

@derberg
Copy link
Member

derberg commented Nov 16, 2023

Let's continue in asyncapi/html-template#456

@derberg derberg closed this as completed Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants