ElMassimo / vite_ruby

⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
https://vite-ruby.netlify.app/
MIT License
1.31k stars 121 forks source link

SSR in production #482

Closed benbonnet closed 3 months ago

benbonnet commented 3 months ago

More or less to report, i was trying out the recent evil martians intertiajs post and trying to get further with the vite ssr capabilities. As of now, unsure if the example repo is enough to get things running, hopefully seeking here some further guidance.

Bug encountered below.


Description 📖

Taking the vite ssr example (https://github.com/ElMassimo/inertia-rails-ssr-template), trying to run in "production" mode.

Logs 📜

web    | file:///xxxxx/inertia-rails-ssr-template/public/vite-ssr/ssr.js:5
web    | const pages = import.meta.globEagerDefault("../pages/*.jsx");
web    |                           ^
web    | 
web    | TypeError: (intermediate value).globEagerDefault is not a function
ElMassimo commented 3 months ago

Hi Ben!

globEagerDefault was an internal API in Vite which was removed in favour of passing options to glob:

import.meta.glob('../pages/*.jsx', { import: 'default', eager: true }),

Please use Discussions instead of Issues if you have additional questions.