Skip to content

[BUG] Missing CSS/JS when generating without singleFile #744

@Shurtu-gal

Description

@Shurtu-gal

Describe the bug.

When generating docs with @asyncapi/html-template version 3.3.0+, the generated index.html references CSS and JS files, but they are not created in the output folder when singleFile is not used.

With 3.2.0, both singleFile=true and singleFile=false modes worked correctly. Starting with 3.3.0, only singleFile=true works.

Tip

I suspect the issue is with the new conditional generation added.

Expected behavior

  • If singleFile=true: generate one standalone HTML file with bundled CSS/JS (works fine in 3.3.1 also).
  • If singleFile=false (or not passed): generate index.html + referenced css/ and js/ assets (broken in 3.3.0+).

Screenshots

Image

How to Reproduce

  1. Run: ./bin/run generate fromTemplate asyncapi.yaml @asyncapi/html-template -o ../docs --use-new-generator --force-write

  2. Example spec (simplified):

asyncapi: 3.0.0
info:
  title: Account Service
  version: 1.0.0
channels:
  userSignedup:
    address: user/signedup
    messages:
      UserSignedUp:
        $ref: '#/components/messages/UserSignedUp'
components:
  messages:
    UserSignedUp:
      payload:
        type: object
        properties:
          email:
            type: string
  1. Open the generated index.html in the browser.

  2. Notice that it references CSS/JS files, but none are generated.

🖥️ Device Information [optional]

  • Operating System (OS):
  • Browser:
  • Browser Version:

👀 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 ?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions