Skip to content

Laravel+React(TS)+Vite+SSR = TypeError: Cannot read properties of undefined (reading 'home') #773

Answered by bakerkretzmar
deniznet asked this question in Q&A
Discussion options

You must be logged in to vote

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).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@deniznet
Comment options

Answer selected by deniznet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #772 on September 05, 2024 15:18.