Closed ancashoria closed 2 weeks ago
@ancashoria Please add a link to reproduction.
I reproduced the problem locally. It breaks on this line https://github.com/withastro/astro/blob/d63d87dcaea85e84acb26b70cbd650d6e1eea6df/packages/astro/src/vite-plugin-astro/index.ts#L207 Because this.environment is new in vite v6 beta https://main.vitejs.dev/changes/this-environment-in-hooks used by astro v5 beta. The cause is that Vanilla-Extract is not (yet) compatible with vite v6 (and transitively, with astro v5). It basically installs vite v5 and that breaks because Astro tries to use it with the new api. In the meantime adding this to the package.json (and running npm install) fixed the problem:
"overrides": {
"@vanilla-extract/vite-plugin": {
"vite": "6.0.0-beta.6"
}
}
I reproduced the problem locally. It breaks on this line https://github.com/withastro/astro/blob/d63d87dcaea85e84acb26b70cbd650d6e1eea6df/packages/astro/src/vite-plugin-astro/index.ts#L207
Because this.environment is new in vite v6 beta https://main.vitejs.dev/changes/this-environment-in-hooks used by astro v5 beta.
The cause is that Vanilla-Extract is not (yet) compatible with vite v6 (and transitively, with astro v5). It basically installs vite v5 and that breaks because Astro tries to use it with the new api.
In the meantime adding this to the package.json (and running npm install) fixed the problem:
"overrides": { "@vanilla-extract/vite-plugin": { "vite": "6.0.0-beta.6" } }
@StevenDepa Since this is a Vite issue, can you please create an issue in Vite repository?
Thanks for the info. I'll just wait for v6 to drop.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Error when using Vanilla Extract based on their guides here
What's the expected result?
I was expecting my styles.css.ts file to be compiled by vanilla-extract and attached to my component
Link to Minimal Reproducible Example
.
Participation