MigrationNew

    The Image Pipeline You Inherit When You Leave Lovable

    A Vite SPA serves image files. A Next.js app runs an image service, and both of Next.js's last two critical advisories lived there. Here is how to scope that during the migration instead of four months after launch.

    A Lovable project is a Vite build — Lovable's own troubleshooting documentation has you opening vite.config.ts when something goes wrong. In a build like that, images are files. You reference one, the bundle or your Supabase Storage bucket hands it over, the browser decodes it, and nothing on your side ever touches the bytes.

    Move that app to Next.js and images stop being files. They become requests to a service you now operate. That service resizes, re-encodes and caches on demand, and it will do that work on an image somebody else chose. Both of the critical advisories Next.js shipped in the last thirty days landed in that service.

    This is not an argument against migrating. The SEO case for server rendering has not changed, and it is most of why our clients move. It is an argument for scoping the image layer on purpose while you are still in the migration, instead of meeting it in an advisory four months after launch.

    What the migration actually adds

    Two pieces, and they fail in different places.

    next/image is the one people know. Next.js describes it as a component that extends the HTML img element for automatic image optimization. Behind it sits the Image Optimization API: it reads the browser's Accept header, picks an output format from the list you configured, resizes, and caches each format separately. Which external hosts it will fetch from is governed by remotePatterns in next.config.js, and the documentation is blunt about why that setting exists — it allows images from specific external paths and blocks all others.

    next/og is the one people forget. It generates images at request time, usually social cards, through ImageResponse. It ships in two implementations, Node.js and Edge. As of yesterday, that distinction is not cosmetic.

    Image handling, before and after

    What changesLovable app (Vite SPA)Next.js app (16.3 or 15.5)
    Who transforms the imageNobody, at request timeYour Image Optimization API, on demand
    Format servedWhatever you uploadedNegotiated from the Accept header; documented default config is image/webp only
    AVIFOnly if you encoded it yourselfOpt-in config, and disabled in the August patched releases pending an upstream fix
    Social card imagesA static file you made onceGenerated per request by next/og, if you use it
    Surface from a remote image URLNone on your sideReal, and bounded only by your remotePatterns config
    What a version bump can changeYour build toolingThe bytes your users receive

    The last thirty days, with dates

    On 25 August 2026, Next.js shipped 16.3.3 (Active LTS) and 15.5.24 (Maintenance LTS) for two critical issues. One was unauthenticated remote code execution in the Image Optimization API when Next.js optimizes an attacker-controlled AVIF image, through the libheif library used by sharp — advisory GHSA-2xp9-vwfh-vxw4. The sentence worth reading twice is Vercel's own: the patched releases disable AVIF optimization until an upstream fix is propagated. A security patch changed what the site serves. Anyone who had opted into AVIF stopped shipping AVIF, and nothing in their repository said so.

    The second August issue was unauthenticated RCE on Windows-hosted servers running both routers without Cache Components. Linux and macOS were not affected, which covers most of the migrations we do — but that is true because of a hosting decision somebody made, not because the application was written carefully.

    On 22 September 2026, an out-of-band update shipped 16.3.6 and 15.5.26 for remote code execution in the Node.js ImageResponse implementation in next/og: improper escaping in the SVG that Satori generates, combined with vulnerabilities in other upstream dependencies. That is GHSA-vcvr-r3jv-pc5j, and the affected range is Next.js 16.2.0 up to but not including 16.3.6. Two details matter for scoping. Applications using the Edge ImageResponse implementation are not affected. And Next.js 15.x is not affected by the remote code execution issue at all — 15.5.26 is related hardening.

    Two critical advisories in twenty-eight days, both in image handling. Treat that as the cadence, not as an unlucky month.

    Four decisions to make during the migration, not after

    1. Decide whether you need the optimizer at all. If your images already sit in Supabase Storage at the sizes you display, pre-sized and served through a CDN, the optimizer is buying you less than it looks. Next.js ships an unoptimized prop for exactly this, and recommends it for images that do not benefit from optimization, such as very small images, SVG and animated GIF. Fewer moving parts is a legitimate architecture, not a cop-out.
    2. Pick your next/og runtime deliberately. If you generate social cards, the Node.js and Edge implementations are not interchangeable from a risk standpoint — yesterday's advisory hit one and not the other. Write down which one you are on, in the repository, where the next person will find it.
    3. Take a position on AVIF before you configure it. The documented default is image/webp only; AVIF is something you switch on. It compresses roughly 20% smaller than WebP and takes about 50% longer to encode, and in August it was the format that got turned off underneath everyone who had enabled it. Enabling it is fine. Enabling it without knowing you did is what hurts.
    4. Set remotePatterns on day one. An optimizer that will fetch and process arbitrary remote URLs is a different product from one that only touches your own bucket. It is a single config block, and far easier to write during the migration than to retrofit once real content references real hosts.

    The part nobody puts on a line item

    None of this is exotic work. Each item above is minutes. What makes it expensive is that the decisions are invisible at handover and the consequences arrive on a schedule nobody owns: an advisory lands on a Tuesday, the fix is a version bump, and the only real question is whether somebody reads the release note inside a week.

    So ask it plainly before you sign a migration. After the last commit, who reads the Next.js release notes, and what is the agreed window for a critical patch? A quote with no answer to that is not dishonest. It is narrower than it sounds, and the gap is the part you end up holding.

    Where we land

    Our own numbers, for the record: 80 jobs on Upwork, 100% Job Success and a 4.9 rating from 30 reviews. Both build tiers, Founding Client at $2,999 and Publishable MVP at $4,999, include production deployment, monitoring, documentation and handoff, and 90-day support until your first paying customer, and the revenue guarantee is first paying customers within 90 days of launch or a full refund. The Founding Client tier carries a 14-day build guarantee with a full refund if the deadline is missed. A Strategy Audit is $499 and is credited toward any build. Two critical patch windows fell inside a single 90-day span this quarter, which is the honest shape of the work: the stack underneath a shipped app keeps moving.

    If you are mid-migration and cannot yet answer the release-note question, that is the conversation to have first. Book your free 20-minute intro call.

    Sources

    Related posts