Skip to content

pack options are not recoginzed in defineProject #2010

Description

@silen-z

Describe the bug

Given this vite.config.ts in monorepo subpackage:

import { defineProject } from "vite-plus";

export default defineProject({
  pack: {
    entry: ["src/index.ts"],
    format: ["esm"],
  },
});

vp check reports this error:

× typescript(TS2769): No overload matches this call.
   ╭─[packages/nested/vite.config.ts:4:3]
 3 │ export default defineProject({
 4 │   pack: {
   ·   ────
 5 │     entry: ["src/index.ts"],
   ╰────

also pack in vite.config.ts in project root, reports no errors.

I also used to hit this error in my full project with more configuration:

  × typescript(TS2321): Excessive stack depth comparing types '{ enabled: true; provider: BrowserProviderOption<PlaywrightProviderOptions>; headless: true; instances: { browser: string; }[]; screenshotFailures: false; }' and 'BrowserConfigOptions | undefined'.

I think they might be related. This Excessive stack depth comparing types error would not always happen and it could complain about different parts of the config here its test options, but I also saw it complain about plugins in pack

But as I removed stuff to create minimal repro only the former error remained.

Reproduction

https://github.com/silen-z/vp-bug-repro

Steps to reproduce

run 'pnpm install' and vp check

System Info

vp v0.2.1

Local vite-plus:
  vite-plus  v0.2.1

Tools:
  vite             v8.0.16
  rolldown         v1.1.1
  vitest           v4.1.9
  oxfmt            v0.55.0
  oxlint           v1.70.0
  oxlint-tsgolint  v0.23.0
  tsdown           v0.22.3

Used Package Manager

pnpm

Logs

Validations

Metadata

Metadata

Assignees

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