asyncapi / cli

CLI to work with your AsyncAPI files. You can validate them and in the future use a generator and even bootstrap a new file. Contributions are welcomed!
https://www.asyncapi.com/tools/cli
Apache License 2.0
187 stars 159 forks source link

Html generated by docker asyncapi/cli does not show anything #924

Closed marcindulak closed 10 months ago

marcindulak commented 11 months ago

Describe the bug

Html generated by docker asyncapi/cli does not show anything

How to Reproduce

I'm following https://www.asyncapi.com/docs/tools/generator/usage#generator-cli, and applying this fix https://github.com/asyncapi/cli/issues/844

curl -sLO https://github.com/asyncapi/cli/raw/master/test/fixtures/asyncapi_v1.yml
docker run --rm -it \
   --user=root \
   -v ${PWD}/asyncapi_v1.yml:/app/asyncapi.yml \
   -v ${PWD}/output:/app/output \
   asyncapi/cli generate fromTemplate -o /app/output /app/asyncapi.yml @asyncapi/html-template --force-write

Output

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[BABEL] Note: The code generator has deoptimised the styling of /usr/local/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.
Generation in progress. Keep calm and wait a bit... done
Check out your shiny new generated files at /app/output.

The generated html is unexpectedly small

ls -al output | tr -s ' ' | cut -d' ' -f5- 

128 Nov 26 20:44 css
20934 Nov 26 20:55 index.html
96 Nov 26 20:44 js

An example of a generated faulty html is on the left, and an expected one on the right

Screenshot 2023-11-26 at 20 58 13
github-actions[bot] commented 11 months 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.

derberg commented 10 months ago

@marcindulak sorry for late response, we were all busy releasing AsyncAPI v3

can you specify version of @asyncapi/html-template that you use? can be checked with --debug flag. Or just us it this way @asyncapi/html-template@2.0.0 to make sure you use the latest one

ldynia commented 10 months ago

The template version was 2.0.0. I confirm that the above example is now working as expected, and the bug is gone.

derberg commented 10 months ago

Thanks a lot and sorry for the issues