Skip to content

[BUG] param pdf does not work with outFilename #826

Description

@FG-TUM

Describe the bug.

When I use the param outFilename=foo to define a custom filename together with param pdf=true the pdf generation throws an error and does not terminate:

$ asyncapi generate fromTemplate AsyncAPI.yaml @asyncapi/html-template --output ./tmp_html_pdf --param pdf=true outFilename=foo --force-write
WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/node-config/node-config/wiki/Strict-Mode
WARNING: No configurations found in configuration directory:/home/USER/AsyncAPI/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
(node:9564) [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
│
◓  Generation in progress. Keep calm and wait a bit[BABEL] Note: The code generator has deoptimised the styling of /home/USER/.nvm/versions/node/v24.13.1/lib/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 bitPDF is generating...
◐  Generation in progress. Keep calm and wait a bit.Error: net::ERR_FILE_NOT_FOUND at file:////home/USER/AsyncAPI/tmp_html_pdf/index.html
  at navigate (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/html-template/node_modules/puppeteer-core/src/cdp/Frame.ts:211:13)
  at Deferred.race (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/html-template/node_modules/puppeteer-core/src/util/Deferred.ts:49:14)
  at CdpFrame.goto (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/html-template/node_modules/puppeteer-core/src/cdp/Frame.ts:164:17)
at CdpPage.goto (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/html-template/node_modules/puppeteer-core/src/api/Page.ts:1773:12)
  at generate:after (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/html-template/hooks/99_generatePdf.js:22:7)
  at /home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/lib/generator.js:1021:14
  at async Promise.all (index 0)
  at Generator.executeAfterHook (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/lib/generator.js:368:5)
  at Generator.generate (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/lib/generator.js:197:5)
at Generator.generateFromString (/home/USER/.nvm/versions/node/v24.13.1/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/lib/generator.js:452:12)
  ◇  Check out your shiny new generated files at ./tmp_html_pdf # needs to be aborted with Ctrl-C
$ ls tmp_html_pdf
css  js  foo

Expected behavior

Two entities:

  • foo.html (+ css and js folders without singleFile)
  • foo.pdf

Screenshots

n/a

How to Reproduce

asyncapi generate fromTemplate foo.yaml @asyncapi/html-template --output ./tmp_html_pdf --param pdf=true outFilename=foo

🖥️ Device Information [optional]

  • Operating System (OS): WSL2
    cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=24.04
    DISTRIB_CODENAME=noble
    DISTRIB_DESCRIPTION="Ubuntu 24.04.3 LTS"

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

No, someone else can work on it

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