vite icon indicating copy to clipboard operation
vite copied to clipboard

fix(css): remove default import in ssr dev

Open bluwy opened this issue 1 year ago • 6 comments

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?

bluwy avatar Aug 22 '24 09:08 bluwy

Review PR in StackBlitz Codeflow 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?).

hi-ogawa avatar Aug 22 '24 09:08 hi-ogawa

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

bluwy avatar Aug 22 '24 09:08 bluwy

/ecosystem-ci run

bluwy avatar Aug 22 '24 09:08 bluwy

📝 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

vite-ecosystem-ci[bot] avatar Aug 22 '24 09:08 vite-ecosystem-ci[bot]

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.

bluwy avatar Aug 22 '24 10:08 bluwy

/ecosystem-ci run

sapphi-red avatar Oct 25 '24 05:10 sapphi-red

📝 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

vite-ecosystem-ci[bot] avatar Oct 25 '24 05:10 vite-ecosystem-ci[bot]

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.

bluwy avatar Oct 28 '24 04:10 bluwy