withastro/astro

vitest.config.mjs in 5.0 beta - Unknown Error: [object object]

Opened this issue · 5 comments

axyl commented

Astro Info

Astro                    v5.0.0-beta.6
Node                     v22.9.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

With an empty vitest.config.mjs

import { getViteConfig } from "astro/config"; export default getViteConfig({});

Running tests gives a
Unhandled Error Unknown Error: [object Object]

Before being able to get to any tests.

I imagine something has changed with the configuration in version 5, but I can't spot anything on the changes list.

Switching to Astro 4.16.9 works fine.

What's the expected result?

Expect to be able to run tests.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-zu7lpm?file=vitest.config.mjs&view=editor

Participation

  • I am willing to submit a pull request for this issue.

I cannot reproduce this locally. Provided project runs without issues as seen below:

Screenshot

Having the same issue, node version 22.10

It worked for me for node 22 as well. Trying to downgrade to the exact versions

Astro                    v5.0.0-beta.7
Node                     v22.11.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

I was able to reproduce it by using exact versions.

Screenshot 2024-11-08 at 10 17 58 PM

HiDeoo commented

Managed to temporarily workaround the issue on my end by overriding the Vite version used, e.g. with pnpm.overrides:

"pnpm": {
  "overrides": {
    "vitest>vite": "6.0.0-beta.6",
    "vite-node>vite": "6.0.0-beta.6"
  }
}