Skip to content

fix(ipx): merge user-defined runtimeConfig.ipx with defaults#2134

Merged
danielroe merged 3 commits into
mainfrom
fix/ipx-runtime-config
Feb 24, 2026
Merged

fix(ipx): merge user-defined runtimeConfig.ipx with defaults#2134
danielroe merged 3 commits into
mainfrom
fix/ipx-runtime-config

Conversation

@DamianGlowala
Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #2089

📚 Description

Merges user-defined runtimeConfig.ipx instead of overriding it with ipxOptions.

@DamianGlowala DamianGlowala changed the title fix(ipx): respect runtimeConfig.ipx fix(ipx): do not override runtimeConfig.ipx Feb 24, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@2134

commit: 29dc125

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 24, 2026

Deploying nuxt-image with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29dc125
Status: ✅  Deploy successful!
Preview URL: https://769f2eba.nuxt-image.pages.dev
Branch Preview URL: https://fix-ipx-runtime-config.nuxt-image.pages.dev

View logs

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

The change modifies the ipx runtime configuration assignment in src/ipx.ts to use the defu utility for merging instead of direct assignment. This preserves existing runtimeConfig.ipx properties while applying ipxOptions, making the behavior consistent with the prerenderer path configuration which already uses defu for merging.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description accurately relates to the changeset, explaining that user-defined runtimeConfig.ipx is merged instead of being overridden.
Linked Issues check ✅ Passed The PR successfully addresses issue #2089 by merging runtimeConfig.ipx with ipxOptions using defu, preserving user-configured values like http.domains in development sections.
Out of Scope Changes check ✅ Passed The single line change is directly scoped to fixing the runtimeConfig.ipx override issue mentioned in the linked issue, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main change: merging user-defined runtimeConfig.ipx with defaults instead of overwriting it.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ipx-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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/ipx.ts (1)

62-65: ⚠️ Potential issue | 🟠 Major

Prerenderer path still overwrites _config.runtimeConfig.ipx — inconsistent with the fix on Line 49.

nitro.options._config.runtimeConfig.ipx is overwritten with defu({ fs: { dir: moduleOptions.dirs } }, ipxOptions) without first merging any user-defined values already present in _config.runtimeConfig.ipx. A user who sets $production.runtimeConfig.ipx (or any non-dev environment override) in their Nuxt config would still have it silently discarded, even after this PR.

The fix should include nitro.options._config.runtimeConfig.ipx as the leading argument so user-provided prerenderer config values survive:

🐛 Proposed fix for the prerenderer path
-  nitro.options._config.runtimeConfig.ipx = defu({ fs: { dir: moduleOptions.dirs } }, ipxOptions)
+  nitro.options._config.runtimeConfig.ipx = defu(nitro.options._config.runtimeConfig.ipx, { fs: { dir: moduleOptions.dirs } }, ipxOptions)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ipx.ts` around lines 62 - 65, The prerenderer branch overwrites
nitro.options._config.runtimeConfig.ipx instead of merging user-provided values;
change the assignment to call defu with the existing
nitro.options._config.runtimeConfig.ipx as the first (leading) argument so user
runtimeConfig.ipx entries are preserved (i.e., defu(existingRuntimeIpX, { fs: {
dir: moduleOptions.dirs } }, ipxOptions)); keep the ipxHandler push as-is
(nitro.options._config.handlers!.push(ipxHandler)).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/ipx.ts`:
- Around line 62-65: The prerenderer branch overwrites
nitro.options._config.runtimeConfig.ipx instead of merging user-provided values;
change the assignment to call defu with the existing
nitro.options._config.runtimeConfig.ipx as the first (leading) argument so user
runtimeConfig.ipx entries are preserved (i.e., defu(existingRuntimeIpX, { fs: {
dir: moduleOptions.dirs } }, ipxOptions)); keep the ipxHandler push as-is
(nitro.options._config.handlers!.push(ipxHandler)).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07fd47d and 6b3d662.

📒 Files selected for processing (1)
  • src/ipx.ts

@DamianGlowala DamianGlowala changed the title fix(ipx): do not override runtimeConfig.ipx fix(ipx): merge user-defined runtimeConfig.ipx with defaults Feb 24, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 6.83%. Comparing base (9b1a21c) to head (29dc125).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
src/ipx.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2134   +/-   ##
=====================================
  Coverage   6.83%   6.83%           
=====================================
  Files         80      80           
  Lines       3732    3732           
  Branches     142     142           
=====================================
  Hits         255     255           
  Misses      3427    3427           
  Partials      50      50           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danielroe danielroe enabled auto-merge (squash) February 24, 2026 23:23
@danielroe danielroe merged commit d6b5bd1 into main Feb 24, 2026
9 checks passed
@danielroe danielroe deleted the fix/ipx-runtime-config branch February 24, 2026 23:28
@github-actions github-actions Bot mentioned this pull request Feb 24, 2026
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.

nuxt config $development section is ignored

3 participants