All posts
Forward Development

Vendure 3.8.2: what the patch fixes and who should upgrade now

Vendure 3.8.2 fixes Dashboard extension pages that break after a redeploy. Here is who each fix affects, the behaviour changes, and how to upgrade from 3.8.x.

  • Vendure
  • Operations
  • Migrations

You redeploy the Vendure Dashboard, and an extension page that worked yesterday now shows "Not Found" or throws Cannot read properties of null (reading 'useContext'). You didn't change the extension. A hard refresh sometimes fixes it for one person and nobody else. That is the headline bug in Vendure 3.8.2, the current patch in the 3.8 line after 3.8.1 and 3.8.0. The release also fixes other problems and changes some behaviour. Most shops can upgrade without trouble. A few need to read the notes first.

This article goes through the fixes by who they affect, so you can decide how urgent the upgrade is and what to check once it is live.

The Dashboard redeploy fix affects anyone with extensions

The Dashboard build used to give an extension chunk the same file name between builds, while the entry chunk it imports got a new one. /assets is served as immutable, so browsers kept running the cached extension chunk against a new entry chunk. That mismatch causes the "Not Found" pages and the useContext error.

From 3.8.2, every build gives each JavaScript chunk a new file name, even when the source hasn't changed. If you ship custom Dashboard extensions and deploy them often, this is the main reason to upgrade.

There is a trade-off. Chunk file names now change on every build, so browsers download the whole Dashboard again after each deploy, and any tooling that expects stable asset names will notice. If you need the old behaviour, set disablePlugins.chunkHash in the Vite plugin options. We would leave the new behaviour on. A full re-download of an admin tool costs less than staff hitting broken pages after a release.

Another Dashboard fix matters more than it sounds. When one user logged out and another signed in, the second user loaded the first user's settings, and their active Channel was saved into the second user's settings. On a shared admin machine in a multi-channel store, that is how people end up editing the wrong channel.

RedisCachePlugin users need to plan the rollout

If you run RedisCachePlugin, read this part before you deploy. Until now, RedisCacheStrategy let tag sets grow without limit. The session cache tag gained one member for every session. In 3.8.2, expired entries are removed from tag sets and each tag set gets an expiry.

The tags also move to a new storage format. They are now kept in sorted sets under <namespace>:ztag:<tag> instead of <namespace>:tag:<tag>. The old sets get no new members, though invalidateTags still empties them. This matters during a rolling deploy. An invalidation sent from an instance still on the old version won't clear entries that upgraded instances tagged. Those entries stay until their TTL expires. If stale prices or stock would be a problem, deploy all instances at once or pick a quiet window, and keep cache TTLs short.

Two more points for operations:

  • Tagged writes now use EVAL. If your Redis connection uses an ACL user, that user needs the @scripting permission. Without it, tagged writes will fail. Check this on managed Redis or Valkey before you deploy.
  • invalidateTags now runs in batches of 1000 and throws when a command fails. It used to ignore errors silently. Errors that were hidden before may now show up in your logs.

The documented minimum is still Redis 3.2, or a compatible server such as Valkey.

Cancelling from ArrangingAdditionalPayment now checks lines

Before 3.8.2, an Order in ArrangingAdditionalPayment could move to Cancelled without the check that every other state runs. Its allocated stock was not released. If your shop cancels orders from that state, your stock levels may already be wrong.

Now the transition to Cancelled fails unless every line of the Order has been cancelled. Any custom admin action, script or integration that cancels these orders directly has to cancel the lines first. Find those code paths before you upgrade, or staff will start seeing failed cancellations.

Resized SVG assets are now served as PNG

When the Asset Server Plugin resized an .svg with no format parameter, it returned PNG data labelled as image/svg+xml. Since 3.7.3, browsers have downloaded those files instead of displaying them. From 3.8.2, they are served as image/png and cached under a .png file name. If a CDN rule, storefront component or image pipeline depends on the old content type or extension, update it.

Smaller fixes worth checking against your store

These fixes don't change behaviour you need to plan for, but each one might explain a bug you have already seen:

  • Promotions. If an item-level Promotion depended on an order total condition such as minimum_order_amount, recalculating an unchanged Order could switch between two totals. That no longer happens. updatePromotion now checks that each action has its required condition, as createPromotion already did. Before, an update could leave buy_x_get_y_free without its condition, and price calculation then failed on freeItemsPerLine. A Promotion already saved without its condition can still be disabled or renamed.
  • Search. updateVariantsById and updateVariants now index every variant. Before, only the first 50 were indexed. If a Collection gained more than 50 variants at once, search({ collectionId }) returned only 50 of them. Reindex after upgrading if you've seen this.
  • Customer emails. Two Customers can no longer end up with the same email address, guest Customers included. The request returns EmailAddressConflictError.
  • BullMQ. BullMQJobQueueStrategy now waits for its Redis connection before it subscribes to job cancellations. Before, cancelling a running job could do nothing.
  • CLI. vendure auth status exits with code 1 when the stored login can't be renewed, and its --json output adds renewable and renewalError. @vendure/create exits with code 1 if it can't copy the email templates or the Docker daemon doesn't respond. Before, it exited with 0 or hung. Check any CI scripts that run these commands.

Upgrading from 3.8.x

The release notes say no APIs are removed or renamed and no database migrations are needed. Upgrade every @vendure/* package to 3.8.2 together. Don't upgrade core and leave the dashboard or plugins on an older patch. Pin the exact version and confirm the lockfile resolves every package to the same version.

Order of work:

  1. Search your code for direct transitions to Cancelled, for anything that relies on resized SVG content types, and for scripts that read CLI exit codes.
  2. If you use RedisCachePlugin, confirm the ACL user has @scripting and choose a deploy strategy.
  3. Upgrade the packages, rebuild the Dashboard and deploy.

Verify the upgrade after deploying

  • Open every custom Dashboard extension page in a browser session that has already cached assets from the previous build. Each page should load without errors.
  • Log out and sign in as a different user, then confirm the active Channel and settings are that user's.
  • In Redis, check that new keys appear under <namespace>:ztag: and that <namespace>:tag: sets stop growing.
  • On staging, try cancelling an ArrangingAdditionalPayment order with uncancelled lines. It should fail. Cancel the lines, try again, and confirm stock is released.
  • Request a resized SVG and check that the response is image/png.

If you are still deciding whether Vendure is the right platform, or you're moving to it from Magento or a custom stack, our migrations overview and the Magento 2 to Medusa or Vendure page explain how we approach it. If you want a second pair of eyes on a 3.8.2 rollout, get in touch.

Need this done on a real stack?

Magento 2, Adobe Commerce, migrations to Medusa.js or Vendure, enterprise Next.js, WordPress, and AI automation.

Contact us