Skip to content

defineConfig drops own properties of Promise plugins (breaks Vike discovery) #3152

Description

@ravilochancsw

What

withoutVitePlusTestPlugins maps plugin instanceof Promise to plugin.then(withoutVitePlusTestPlugins). .then() creates a new promise that does not carry the original promise's own properties.

Impact

vike() (vike/plugin@0.4.268) returns a Promise carrying _vikeVitePluginOptions as an own property — verified present on the promise itself and absent from all 41 resolved plugins. Vike discovers its plugin by scanning the raw user config for that field, so after vp's re-wrap the field is gone: vike build warns Omitting Vike's Vite plugin and then fails inside @brillout/vite-plugin-server-entry (resolveConfig).

Current workaround is a sync marker object that copies the field (awaiting first is not an option — it destroys the marker; a lazy async factory reintroduces the same failure since it yields [Promise]).

Ask

Preserve own props across the re-wrap (e.g. copy them onto the settled wrapper), or document that Promise plugins must be prop-free so downstream authors know to use a marker.

Repro

// vite.config.ts (loaded through vp's defineConfig)
import { defineConfig } from 'vite-plus';
import vike from 'vike/plugin';
export default defineConfig({ plugins: [vike()] });

vike build fails as above. The identical config through vite's own defineConfig builds fine.

Versions

vite-plus 1.3.0, vike 0.4.268, vite-plus-core 1.3.0

Activity

  1. added theissue type on Oct 20, 2026
  2. self-assigned this
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions