Skip to content

SSR dynamic chunks are emitted under the wrong relative directory #273

Description

@joshamaju

Summary

When building for production, Stack54 emits SSR dynamic chunks into dist/client, while the generated server entry retains imports such as ./client/<chunk>.js. From dist/server/entry.js, those imports resolve to dist/server/client/<chunk>.js, not the emitted dist/client/<chunk>.js.

Impact

Deployments can fail at runtime when the SSR entry dynamically imports optional/infrastructure chunks. Consumers currently need to copy the complete client chunk set into dist/server/client after a successful build.

Expected behavior

Either:

  • emit the SSR-referenced chunks under dist/server/client, or
  • rewrite the generated server imports to the actual emitted location, or
  • document the required post-build asset step as part of the supported build output.

Reproduction / evidence

A downstream project using Stack54 0.15.0 and Vite 7.3.6 has this workaround in its production build wrapper: https://github.com/joshamaju/relay/blob/master/scripts/build.mjs

The workaround copies dist/client recursively to dist/server/client because the generated server-relative imports otherwise point at missing files.

Please let me know if a minimal fixture or generated output listing would help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions