fix(css): remove default import in ssr dev
Description
Found from https://github.com/withastro/astro/issues/11811
In SSR dev, we still incorrectly support default imports of a CSS file (without queries). This feels like a bug fix, but technically I guess it affects frameworks like vitest that executes in SSR and serve mode?
Run & review this pull request in StackBlitz Codeflow.
I think Vinxi and Remix are relying on default export of ssrLoadModule without ?inline https://github.com/remix-run/remix/blob/c5292edb5997b0818105944b33da7c4cd4567511/packages/remix-dev/vite/styles.ts#L77-L79. Can you check ecosystem ci?
If this was meant to be deprecated already, then maybe it's okay to change though (also it might be just a one liner fix on their end?).
Yeah it was deprecated in the previous major, and removed in this major (https://vitejs.dev/guide/migration.html#removed-deprecated-apis). Frameworks need to use ?inline to work, which I thought most have needed to migrated, but maybe we didn't check thoroughly 🤔 I'll run ecosystem-ci to check
/ecosystem-ci run
📝 Ran ecosystem CI on b1a7eab: Open
| suite | result | latest scheduled |
|---|---|---|
| astro | :x: failure | :white_check_mark: success |
| nuxt | :white_check_mark: success | :x: failure |
| qwik | :x: failure | :x: failure |
| remix | :x: failure | :white_check_mark: success |
| storybook | :white_check_mark: success | undefined undefined |
| sveltekit | :x: failure | :white_check_mark: success |
| vitest | :white_check_mark: success | :x: failure |
:white_check_mark: analogjs, histoire, ladle, laravel, marko, previewjs, quasar, rakkas, unocss, vike, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress
Looks like astro, remix, and sveltekit all fails and likely related to the CSS handling, so this would be breaking then unfortunately. Let's move this to the next major then.
/ecosystem-ci run
📝 Ran ecosystem CI on c8a13ec: Open
| suite | result | latest scheduled |
|---|---|---|
| astro | :x: failure | :x: failure |
| nuxt | :x: failure | :x: failure |
| redwoodjs | :x: failure | :x: failure |
| remix | :x: failure | :x: failure |
| sveltekit | :x: failure | :x: failure |
| vike | :x: failure | :x: failure |
| vite-plugin-svelte | :x: failure | :x: failure |
| vitest | :x: failure | :x: failure |
:white_check_mark: analogjs, histoire, ladle, laravel, marko, previewjs, quasar, qwik, rakkas, storybook, unocss, vite-environment-examples, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-vue, vite-setup-catalogue, vitepress, vuepress
From the initial ecosystem-ci run, this affected astro, remix and sveltekit, so perhaps we should delay merging this until we can get them passing in main so it's easier to narrow down the required migration. But either ways if we want to merge this now, I don't mind.