-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: getViteConfig
doesn't work after 4.9.3 release
#11221
Comments
Hello @vchirikov. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
@ematipico added repository with repro - https://github.com/vchirikov/astro_issue_11221 |
I'm not 100% sure the issue I encountered is the exact same, but it looks related. The vite config seems ignored, at least the include and exclude properties.
For this purpose, I defined a Please tell me if you need more info, or if I missed something. |
As a side note, passing my config as the 2nd arg gives me the expected result, but I don't think this is intended. According to #11194 only
|
Yep, but according the docs we should use the first arg. For now I use the same workaround: import { getViteConfig, type ViteUserConfig } from 'astro/config';
// ...
const config = {
test: { /* the actual vitest config*/}
} satisfies { test: ViteUserConfig['test']; };
export default getViteConfig(
{ ...config },
{ vite: { ...config }},
); |
Absolutely, I just wanted to emphase that the 2 args got mixed up in the quoted PR |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Regression:
getViteConfig
is broken after 4.9.3+ (including the latest 4.10.1) and doesn't return the correct config to vitest.In the gif I showed that the regression:
getViteConfig
works fine (it returns correctenvironment
to vitest) and doesn't work at 4.10.1(
ReferenceError: document is not defined
shows us that vitest'senvironment
is not defined, I also re-checked this with// @vitest-environment happy-dom
)the vitest.config.ts:
Repro
https://github.com/vchirikov/astro_issue_11221
What's the expected result?
getViteConfig
returns the correct config with definedenvironment
The text was updated successfully, but these errors were encountered: