Laravel+React(TS)+Vite+SSR = TypeError: Cannot read properties of undefined (reading 'home') #773
-
Hello! TypeError: Cannot read properties of undefined (reading 'home') vite.config.js
ssr.tsx. Here I limited SSR only for component in Public forlder. Another folder incloud page which cannot build for ssr (during php artisan inertia:start-ssr).
app.tsx
jsconfig.json:
Spand a lot of time, but not found solution. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's not clear from your code snippets whether you've actually installed Ziggy and set it up at all, have you? Does it work normally for non-SSR cases? Does your app work with SSR if you remove the Ziggy code you're trying to use? You will probably have to pass Ziggy's routes and config from your backend during SSR and then set them onto the global Ziggy object manually. See #432 (comment) (Vue, but same idea). |
Beta Was this translation helpful? Give feedback.
It's not clear from your code snippets whether you've actually installed Ziggy and set it up at all, have you? Does it work normally for non-SSR cases?
Does your app work with SSR if you remove the Ziggy code you're trying to use?
You will probably have to pass Ziggy's routes and config from your backend during SSR and then set them onto the global Ziggy object manually. See #432 (comment) (Vue, but same idea).