Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Possible Vite 8 SSR regression: side-effect-only imports removed from server bundle (worked on Vite 7) #608

@jansedlon

Description

@jansedlon

Describe the regression

Hi Vite team 👋

After upgrading from Vite 7 to Vite 8 (Rolldown), we hit what looks like a SSR tree-shaking regression.

What we see

In our Remix server entry, we had side-effect-only imports used to bootstrap background workers:

// app/entry.server.tsx
import "~/utils/workers/stripe-connect-webhook-processor.server.ts";
import "~/utils/workers/stripe-webhook-processor.server.ts";

Each imported module initializes BullMQ workers at module top-level (e.g. new Worker(...) + event handlers).

After building SSR with Vite 8, those worker modules are not present in build/server/index.js, so jobs are still enqueued but never consumed.

Why this was surprising

Same code path worked before the upgrade (Vite 7).
Producers stayed in the bundle, but worker bootstrap code disappeared.
Runtime symptom: Stripe webhook queue fills up, no worker processing.

Environment

Vite: 8.0.0-beta.16
Node: 22.19.0
pnpm: 10.12.4
OS: macOS (Darwin 25.3.0)
Framework: Remix (@remix-run/* via Vite plugin)

Potentially relevant detail

Our package has:

"sideEffects": false
Honestly don't know why we have this.
Vite 8 now seems to treat side-effect-only imports much more aggressively in SSR builds.

Workaround

Changing to explicit startup calls keeps the code in SSR output and fixes runtime behavior:

import { startStripeConnectWebhookProcessorWorker } from "~/utils/workers/stripe-connect-webhook-processor.server.ts";
import { startStripeWebhookProcessorWorker } from "~/utils/workers/stripe-webhook-processor.server.ts";
startStripeConnectWebhookProcessorWorker();
startStripeWebhookProcessorWorker();

Question

Is this an intended behavior change with Rolldown + SSR + "sideEffects": false, or a regression from Vite 7 behavior?

If this is expected, could this be documented in migration notes? This pattern (side-effect bootstrap imports in server entry) is easy to miss and can fail silently.

Reproduction

https://github.com/jansedlon/my-react-router-app

Expected Behavior

To behave the same as Vite 7 or document the change somewhere.

Actual Behavior

To work

Steps to Reproduce

Run pnpm dev to see that the worker is imported and outputs a console log. The run pnpm build && pnpm start` and the console log is not there because the file is removed from the bundle.

System Info

System:
    OS: macOS 26.3
    CPU: (16) arm64 Apple M3 Max
    Memory: 3.88 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.19.0 - /Users/jansedlon/.local/state/fnm_multishells/51102_1772783323168/bin/node
    npm: 10.9.3 - /Users/jansedlon/.local/state/fnm_multishells/51102_1772783323168/bin/npm
    pnpm: 10.12.4 - /Users/jansedlon/Library/pnpm/pnpm
    bun: 1.3.5 - /Users/jansedlon/.bun/bin/bun
  Browsers:
    Chrome: 145.0.7632.160
    Safari: 26.3

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions