inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.26k stars 421 forks source link

Laravel + Webpack + Inertia + SSR leads to crash #1453

Closed blursolo closed 1 year ago

blursolo commented 1 year ago

I've followed this guide in order to enable SSR: https://legacy.inertiajs.com/server-side-rendering

After running node public/js/ssr.js and visiting the website it crashes:

Starting SSR server on port 13714...
Inertia SSR server started.
TypeError: Cannot read properties of null (reading 'dataset')
    at exports.createInertiaApp (/www/htdocs/xxxxxx/laravel/node_modules/@inertiajs/inertia-vue3/dist/index.js:1:9300)
    at /www/htdocs/xxxxxx/laravel/public/js/ssr.js:2854:83
    at /render (/www/htdocs/xxxxxx/laravel/node_modules/@inertiajs/server/lib/index.js:32:33)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Server.<anonymous> (/www/htdocs/xxxxxx/laravel/node_modules/@inertiajs/server/lib/index.js:46:37)

The script tag in my app.blade.php does have a defer tag.

Any help highly appreciated.

SergkeiM commented 1 year ago

Hi @rororomeda is better to ask in discord for help

blursolo commented 1 year ago

@SergkeiM Why? I changed versions so it seems to be a bug. I am running now: Laravel 9.19 Inertia 0.6.8

Now it works : )

reinink commented 1 year ago

Hey! Thanks so much for your interest in Inertia.js and for sharing this issue/suggestion.

In an attempt to get on top of the issues and pull requests on this project I am going through all the older issues and PRs and closing them, as there's a decent chance that they have since been resolved or are simply not relevant any longer. My hope is that with a "clean slate" me and the other project maintainers will be able to better keep on top of issues and PRs moving forward.

Of course there's a chance that this issue is still relevant, and if that's the case feel free to simply submit a new issue. The only thing I ask is that you please include a super minimal reproduction of the issue as a Git repo. This makes it much easier for us to reproduce things on our end and ultimately fix it.

Really not trying to be dismissive here, I just need to find a way to get this project back into a state that I am able to maintain it. Hope that makes sense! ❤️