Skip to content

fix: drop unused log dir setup that triggered node-config warnings - #2327

Closed
suryakant-source wants to merge 2 commits into
asyncapi:masterfrom
suryakant-source:patch-1
Closed

suryakant-source wants to merge 2 commits into
asyncapi:masterfrom
suryakant-source:patch-1

Conversation

@suryakant-source

Copy link
Copy Markdown

Fixes #2323
Fixes #2293

Problem

Every CLI command that loads an AsyncAPI document (validate, convert, generate, bundle, diff, ...) prints four node-config warning lines before its real output, because src/utils/logger.ts imports the config package at module load. The CLI ships no config/ directory, so config warns about the missing configuration and the unmatched NODE_ENV=production deployment on every run.

Fix

Remove the unused config import and the logDir/mkdirSync block from src/utils/logger.ts. The winston logger only has a Console transport, so the directory was created but never written to. Nothing else in src/ reads the directory, and logger.ts only exports logger and stream.

This also removes the mkdirSync race from #2293, so #2294 is no longer needed.

The API server path is unaffected: src/apps/api/app.ts imports config itself and NODE_CONFIG_DIR is set before it loads.

Removes the unused config/logDir/mkdirSync block from src/utils/logger.ts. The winston logger has no file transport, so the directory was created but never written to. Importing the config package at module load made every document command print four node-config warnings (fixes asyncapi#2323) and the mkdirSync raced in parallel runs (fixes asyncapi#2293).
@changeset-bot

changeset-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b638338

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to To Triage in CLI - Kanban Oct 20, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide 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.

@sonarqubecloud

Copy link
Copy Markdown

@frederikb frederikb mentioned this pull request Oct 28, 2026
2 tasks done
@Shurtu-gal

Copy link
Copy Markdown
Collaborator

Fixed under #2324

@Shurtu-gal Shurtu-gal closed this Nov 2, 2026
@github-project-automation github-project-automation Bot moved this from To Triage to Done in CLI - Kanban Nov 2, 2026
@suryakant-source

Copy link
Copy Markdown
Author

Thanks for the update and for fixing this in #2324.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] Every document command prints four node-config WARNING lines before its output [BUG] asyncapi cli race condition crash

2 participants