adonisjs / adonisjs/vite

Client assets overwritten by SSR build when no serverEntryPoints are configured

Open
#44 0 comments 1 reaction 1 assignee View on GitHub

@thetutlage is already working on this.

Since Sep 7, 2026.

Type: Bug
Dominant language
TypeScript
Stars
49
Forks
8
Avg merge
2d 15h
Merged PRs (30d)
2

Description

Package version

6.0.1

Describe the bug

After upgrading to @adonisjs/vite 6 and Vite 8, node ace build runs both a client build and an SSR build, even though our application has Inertia SSR disabled and no serverEntryPoints configured.

Both builds use public/assets as their output directory. The SSR build runs second and overwrites the client assets and manifest. The command completes successfully, but the resulting frontend entry contains server-rendering code and unresolved package imports.

Versions
  • @adonisjs/core: 7.5.0
  • @adonisjs/vite: 6.0.1
  • vite: 8.2.2
  • @vitejs/plugin-vue: 6.0.8
  • @adonisjs/inertia: 5.0.1
  • @inertiajs/vue3: 3.7.0
Relevant configuration

config/inertia.ts:

export default defineConfig({
  rootView: 'inertia_layout',
  ssr: {
    enabled: false,
  },
})

Relevant plugins in vite.config.ts:

plugins: [
  vue(),
  adonisjs({
    entryPoints: ['inertia/main.ts'],
    reload: ['resources/views/**/*.edge'],
  }),
]

No serverEntryPoints, custom SSR environment, or custom output directory is configured.

Steps to reproduce
  1. Run node ace build with the configuration above.
  2. Observe that Vite builds the client environment, then the SSR environment.
  3. Inspect build/public/assets/.vite/manifest.json.
  4. Open the file referenced by the inertia/main.ts entry.
Actual result

The final manifest points to main.js. It also imports SSR helpers, including ssrRenderComponent, from "vue/server-renderer".

Expected result

With no server entry points configured, the production build should preserve the client bundle and its manifest, without an additional SSR build overwriting them.

Investigation and workaround

The Vue plugin contributes top-level SSR options. Vite creates an SSR environment, and the Adonis build hook calls createBuilder({}, false).buildApp(), which builds both environments.

Explicitly building only the client environment prevents the issue:

builder: {
  async buildApp(builder) {
    await builder.build(builder.environments.client)
  },
},
Reproduction repo

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.