Skip to content

fix(bunny): merge query params with existing image src#2054

Merged
danielroe merged 1 commit into
nuxt:mainfrom
infabo:patch-1
Dec 16, 2025
Merged

fix(bunny): merge query params with existing image src#2054
danielroe merged 1 commit into
nuxt:mainfrom
infabo:patch-1

Conversation

@infabo
Copy link
Copy Markdown
Contributor

@infabo infabo commented Dec 3, 2025

In case the image src already contains a query parameter, it is necessary to properly add bunny query params. This is accomplished using withQuery helper from ufo.

🔗 Linked issue

resolves #2055

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

In case the image src already contains a query parameter, it is necessary to properly add bunny query params. This is accomplished using withQuery helper from ufo.

e.g. url is http://example.com/image.jpg?timestamp

@infabo infabo requested a review from danielroe as a code owner December 3, 2025 17:13
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Dec 3, 2025

Open in StackBlitz

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

commit: f7f0c10

Comment thread src/runtime/providers/bunny.ts Outdated

const operationsGenerator = createOperationsGenerator({
keyMap: {
const operationsGenerator = createMapper({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is there a reason you changed this? I think it's causing the type checking errors below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because withQuery needs an mapped object instead of a concatenated query string.

@infabo infabo force-pushed the patch-1 branch 7 times, most recently from 952df27 to ea8bedc Compare December 12, 2025 15:46
In case the image src already contains a query parameter, it is necessary to properly add bunny query params. This is accomplished using withQuery helper from ufo.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.99%. Comparing base (9fc971d) to head (f7f0c10).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/runtime/providers/bunny.ts 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2054   +/-   ##
=====================================
  Coverage   6.99%   6.99%           
=====================================
  Files         78      78           
  Lines       3629    3629           
  Branches     140     140           
=====================================
  Hits         254     254           
  Misses      3326    3326           
  Partials      49      49           

☔ 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 changed the title fix: use withQuery to build bunny url fix(bunny): merge query params with existing image src Dec 16, 2025
@danielroe danielroe merged commit 0c146ba into nuxt:main Dec 16, 2025
7 checks passed
@github-actions github-actions Bot mentioned this pull request Dec 10, 2025
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.

bunny provider: can't handle src urls with query params

3 participants