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

[BUG] Messages and Examples not rendered in html-generator #1324

Closed
2 tasks done
sschleemilch opened this issue Dec 13, 2024 · 3 comments
Closed
2 tasks done

[BUG] Messages and Examples not rendered in html-generator #1324

sschleemilch opened this issue Dec 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sschleemilch
Copy link

Describe the bug.

I have a problem with the async api html generator.
It started last week with that message:

Generator Error: [BABEL]: Cannot find module '/usr/local/lib/node_modules/@asyncapi/cli/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js' (While processing: /usr/local/lib/node_modules/@asyncapi/cli/node_modules/@babel/preset-env/lib/index.js)

I upgraded then the versions of the cli and the html template generator.
I am using github actions and my config looks like that:

on:
  push:
    branches: [main]

permissions:
  contents: write

jobs:
  generate:
    runs-on: ["ubuntu-latest"]
    steps:
      - name: checkout
        uses: actions/checkout@v4

      - name: generate
        uses: asyncapi/[email protected]
        with:
          cli_version: v2.12.1
          template: "@asyncapi/[email protected]"
          filepath: spec/api/asyncapi.yaml
          parameters: --use-new-generator
          output: out

      - name: deploy
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: out

Generation works partially.
Messages and examples are not getting rendered. However, pasting my asyncapi.yaml into https://studio.asyncapi.com/ it is rendered just fine.

I also posted this one on slack: https://asyncapi.slack.com/archives/CQVJXFNQL/p1734014340905819

GitHub Actions output:

CLI version: v2.12.1
  Installing AsyncAPI CLI: v2.[12](https://atc-github.azure.cloud.bmw/coffee/ecosys.data_middleware.spec/actions/runs/13443033/job/37301850#step:4:13).1
  npm warn deprecated @asyncapi/[email protected]: Hooks are now part of generator repository and also out of the box integrated with the generator, so no need to set it as dependency any more: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.5.0
  npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
  npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
  npm warn deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
  npm warn deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
  npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
  npm warn deprecated [email protected]: This functionality has been moved to @npmcli/fs
  npm warn deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
  npm warn deprecated [email protected]: This package is no longer supported.
  npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
  npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
  npm warn deprecated [email protected]: Use your platform's native DOMException instead
  npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
  npm warn deprecated [email protected]: This package is no longer supported.
  npm warn deprecated [email protected]: This package is no longer supported.
  npm warn deprecated [email protected]: This package is no longer supported.
  npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
  npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
  npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
  npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
  npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
  npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
  npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
  npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
  npm warn deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
  npm warn deprecated @hyperjump/[email protected]: This package was rolled into @hyperjump/json-schema as of v1.0.0
  
  
  178 packages are looking for funding
    run `npm fund` for details
AsyncAPI CLI version: @asyncapi/cli/2.12.1 linux-x64 node-v18.20.4
Executing AsyncAPI CLI...
Debug information
  Command: generate
  File: /github/workspace/spec/api/asyncapi.yaml
  Template: @asyncapi/[email protected]
  Language: 
  Output: /github/workspace/out
  Parameters: --use-new-generator

Expected behavior

Messages end examples being rendered

Screenshots

image

How to Reproduce

Not sure. I also have a problem running the async api generator locally on MacOS:

All I get is:

❯ asyncapi generate fromTemplate spec/api/asyncapi.yaml @asyncapi/[email protected] --use-new-generator --force-write
(node:95616) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
┌  AsyncAPI Generator
│
◇  Please provide the output directory
│  ./docs
│
◇  Generation failed
Generator Error: Installation failed

On GitHub actions it runs fine though.

🥦 Browser

Google Chrome

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

@sschleemilch sschleemilch added the bug Something isn't working label Dec 13, 2024
Copy link
Contributor

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.

@sschleemilch
Copy link
Author

I also tried different combinations of versions now.
E.g. cli: 2.8.0 and html-template 3.0.0 because that version is there in the dev dependencies in the package.lock.
No luck though...

@sschleemilch
Copy link
Author

Okay, I just reverted a commit where I ran asyncapi optimize and now generation works fine again... So might we have still a problem here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant