Describe the bug.
When running the CLI with --watch, the process crashes immediately after initial generation with:
TypeError: thisArg.isLocalTemplate is not a function
The error occurs inside runWatchMode() in:
cli/src/utils/generate/watcher.ts
The function incorrectly calls:
thisArg.isLocalTemplate(...)
However, isLocalTemplate is a standalone exported function, not a method on the CLI command instance (thisArg). This results in an undefined function call and crashes watch mode.
Expected behavior
When running CLI with --watch:
- Initial generation should complete successfully.
- Watcher should start monitoring changes.
- No runtime errors should occur.
- The process should remain alive and continue watching for changes.
Screenshots
How to Reproduce
- Run watch mode:
asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template --watch --output ./out
-
Observe initial successful generation.
-
After watcher starts, the CLI crashes with:
TypeError: thisArg.isLocalTemplate is not a function
🖥️ Device Information [optional]
- Operating System (OS): Windows(WSL)
- Browser:
- Browser Version:
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
Describe the bug.
When running the CLI with
--watch, the process crashes immediately after initial generation with:TypeError: thisArg.isLocalTemplate is not a function
The error occurs inside
runWatchMode()in:The function incorrectly calls:
thisArg.isLocalTemplate(...)However,
isLocalTemplateis a standalone exported function, not a method on the CLI command instance (thisArg). This results in an undefined function call and crashes watch mode.Expected behavior
When running CLI with
--watch:Screenshots
How to Reproduce
Observe initial successful generation.
After watcher starts, the CLI crashes with:
🖥️ Device Information [optional]
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!