Vite plugins (transforms) not run in SSR
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.14.0
- Nuxt Version:
3.0.0-rc.8-27673198.b4bea51
- Package Manager:
yarn@1.22.17
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/nuxt-starter-cmbd9g
Describe the bug
Seems like Vite transforms are not run in SSR in development mode, leading to a blink on these transforms while developing / booting the server.
Additional context
Not sure about transforms outside of Vue SFCs, but this one specifically occurs in <style> templates of Vue components which might (maybe?) receive a different treatment?
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Server-Side Rendering
Dependencies are "externalized" from Vite's SSR transform module system by default when running SSR. This speeds up both dev and build. If a...
Read more >Can't get @vitejs/plugin-legacy working · Issue #39
I guess it's due to vite-plugin-ssr not using Vites static index.html file. No, the HTML transformers of all plugins are applied.
Read more >Using vite-plugin-ssr with mdx-js, solving ESM only library ...
The plugin transforms the build files and replaces the import as given as options to the plugin. Now you can run npm run...
Read more >Dev SSR on Nuxt with Vite
Vite's dev server provides a method called transformRequest() , which is the same as you requesting a module from the browser but in...
Read more >What About Vite SSR?
Why not put server.js in the product? See the “Production environment doesn't work out of the box” section below. The role of server.js...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
/cc @antfu maybe we could introduce some transformInclude presets or utility from unplugin to make it standard?
Regex
/\?vue&type=style/
intranaformInclude
was not covering all cases. Some server transform ids look like this:Simply changing to
/vue&type=style/
fixes issue but I would suggest usingufo
parser.