Skip to content

fix(nuxt): bake evlog config into nitro replace for silent mode#369

Merged
HugoRCD merged 1 commit into
mainfrom
fix/nuxt-silent-nitro-replace
Jun 9, 2026
Merged

fix(nuxt): bake evlog config into nitro replace for silent mode#369
HugoRCD merged 1 commit into
mainfrom
fix/nuxt-silent-nitro-replace

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Resolves #368

Summary by CodeRabbit

  • Bug Fixes
    • Fixed the silent option in evlog to properly suppress console output in Nuxt production builds on evlog 2.11+. The evlog configuration is now correctly passed to the Nitro plugin, preventing unenriched log lines from being emitted before expected hooks execute.

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evlog-docs Ready Ready Preview, Comment, Open in v0 Jun 9, 2026 8:22pm
just-use-evlog Ready Ready Preview, Comment Jun 9, 2026 8:22pm

@github-actions github-actions Bot added the bug Something isn't working label Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8ce15cbe-6d10-46d9-9daa-0eac90b35e10

📥 Commits

Reviewing files that changed from the base of the PR and between 7c046d0 and 7846b55.

📒 Files selected for processing (4)
  • .changeset/nuxt-silent-nitro-replace.md
  • packages/evlog/src/nuxt/module.ts
  • packages/evlog/test/nitro/module-paths.test.ts
  • packages/evlog/test/shared/nitroConfigBridge.test.ts

📝 Walkthrough

Walkthrough

Nuxt's evlog module now serializes runtime configuration into nitro.options.replace.__EVLOG_CONFIG__, ensuring the Nitro plugin receives the full config including silent: true. This prevents unlogged console output before the evlog:drain hook executes in production builds.

Changes

Evlog Nitro Config Serialization

Layer / File(s) Summary
Core implementation and regression test update
packages/evlog/src/nuxt/module.ts, packages/evlog/test/nitro/module-paths.test.ts
The Nitro nitro:config hook JSON-stringifies the evlog config into nitroConfig.replace.__EVLOG_CONFIG__ alongside process.env.__EVLOG_CONFIG. The regression test is updated to pass silent: true and asserts the replace config parses to the expected structure containing both env.service and silent fields.
Config resolution test for silent mode
packages/evlog/test/shared/nitroConfigBridge.test.ts
New test verifies that resolveEvlogConfigForNitroPlugin() preserves silent: true when the inlined globalThis.__EVLOG_CONFIG__ is read, without probing Nitro/nitropack runtime modules.
Release documentation
.changeset/nuxt-silent-nitro-replace.md
Changeset documents that Nuxt's silent option now suppresses built-in console output for evlog 2.11+ in production by embedding evlog options into Nitro's nitro.options.replace.__EVLOG_CONFIG__.

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • HugoRCD/evlog#340: Both PRs use the same Nitro inlining mechanism (nitro.options.replace.__EVLOG_CONFIG__) to allow the config bridge to read Evlog config as a bundled literal instead of probing runtime modules—this PR additionally threads silent: true through that mechanism.

Suggested labels

bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely missing; no content was provided despite the repository template requiring at least a description section. Add a description explaining why this change is needed, what problem it solves, and reference the evlog 2.11+ behavior change. Also link any related issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix: embedding evlog config into Nitro's replace mechanism to enable silent mode in Nuxt.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nuxt-silent-nitro-replace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Jun 9, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/evlog@369
npm i https://pkg.pr.new/@evlog/nuxthub@369

commit: 7846b55

@HugoRCD HugoRCD self-assigned this Jun 9, 2026
@HugoRCD HugoRCD merged commit 0c6cb24 into main Jun 9, 2026
20 checks passed
@HugoRCD HugoRCD deleted the fix/nuxt-silent-nitro-replace branch June 9, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Silent option in nuxt project fails on version 2.11+

1 participant