Skip to content

fix(config): inline config for useRuntimeConfig() composable#1737

Open
danielroe wants to merge 3 commits into
mainfrom
fix/inlined-runtime-config
Open

fix(config): inline config for useRuntimeConfig() composable#1737
danielroe wants to merge 3 commits into
mainfrom
fix/inlined-runtime-config

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

spotted this in elk-zone/elk#3681 - useRuntimeConfig() currently throws if we don't set window properties, but I think we can resolve by inlining the config directly in the template the way this works in dev mode

Comment thread src/module.ts Fixed
@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/test-utils@1737
npm i https://pkg.pr.new/vitest-environment-nuxt@1737

commit: 717212d

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9d47f86c-d930-48fb-85b8-1cf29c647637

📥 Commits

Reviewing files that changed from the base of the PR and between ed40935 and 717212d.

📒 Files selected for processing (2)
  • examples/app-vitest-full/tests/resolved-files.spec.ts
  • src/module.ts

📝 Walkthrough

Walkthrough

For non-development test builds, the paths.mjs template now inlines serialized nuxt.options.app configuration and removes its runtime configuration import. A new happy-dom Vitest spec verifies the virtual paths module exports can be called without throwing. The resolved-files test now expects three regular spec files.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: inlining config for useRuntimeConfig().
Description check ✅ Passed The description matches the PR objective and explains the runtime-config inlining fix.
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.
✨ 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/inlined-runtime-config

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/module.ts`:
- Around line 49-54: Update the second replace call in template.getContents to
use a replacer function that returns the injected inlineAppConfig expression,
preventing $ sequences in the configuration from being interpreted as
replacement patterns. Leave the import-removal replacement unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7fa15ba-fc67-4092-b7c2-0ce2e551ed32

📥 Commits

Reviewing files that changed from the base of the PR and between e8d2301 and ed40935.

📒 Files selected for processing (2)
  • examples/app-vitest-full/tests/paths.spec.ts
  • src/module.ts

Comment thread src/module.ts
Comment thread src/module.ts Dismissed
@danielroe
danielroe requested a review from yamachi4416 July 18, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants