asyncapi / html-template

HTML template for AsyncAPI Generator. Use it to generate a static docs. It is using AsyncAPI React component under the hood.
63 stars 56 forks source link

Creating Templates with Single File Parameter causes Error #78

Closed oanguin closed 3 years ago

oanguin commented 3 years ago

Describe the bug

When using the single file parameter an error is thrown.

How to Reproduce

ag "schemas/school-events.yaml" @asyncapi/html-template --output "docs/school-events/" -p singleFile=true --force-write
Something went wrong:
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received { recursive: true }
    at makeCallback (fs.js:133:11)
    at Object.rmdir (fs.js:675:14)
    at generate:after (/usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/hooks/01_removeNotRelevantParts.js:21:16)
    at /usr/local/lib/node_modules/@asyncapi/generator/lib/generator.js:756:20
    at Array.map (<anonymous>)
    at Generator.launchHook (/usr/local/lib/node_modules/@asyncapi/generator/lib/generator.js:754:43)
    at Generator.generate (/usr/local/lib/node_modules/@asyncapi/generator/lib/generator.js:188:16)
    at async /usr/local/lib/node_modules/@asyncapi/generator/cli.js:123:9

Version Used

Expected behavior

The templates are generated correctly.

github-actions[bot] commented 3 years ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. 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 3 years ago

This is strange. The issue is related to this but from the docs looks like it is used properly but this is still an experimental function. When I was testing I was on Node.js 12.18.3 and all was fine. Maybe they are breaking experimental features more often 🤔 try upgrading to 12.18 and let us know how it works. We will most probably have to replace current logic with something stable.

oanguin commented 3 years ago

This is strange. The issue is related to this but from the docs looks like it is used properly but this is still an experimental function. When I was testing I was on Node.js 12.18.3 and all was fine. Maybe they are breaking experimental features more often 🤔 try upgrading to 12.18 and let us know how it works. We will most probably have to replace current logic with something stable.

The bug does not occur in version 12.18 of Node as mentioned by @derberg .

derberg commented 3 years ago

video about how to solve the issue https://youtu.be/Iqs_2BiNEEo?t=1110

asyncapi-bot commented 3 years ago

:tada: This issue has been resolved in version 0.12.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: