Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

successdav's avatar

Undefined variable: page - Integrating Inertiajs

I am trying to integrate inertiajs to an existing laravel project. Having completed the steps outlined here https://inertiajs.com/server-side-setup

I reload the page and it displays the error: Undefined variable: page The error seems to be caused by adding @inertia to the body of the site

0 likes
4 replies
vincent15000's avatar

@successdav Sorry I don't have any other advice, I don't really know inertiajs, I just read the documentation yesterday because I want to try it.

1 like
kmuenkel's avatar

I was able to clear this error just by running php artisan optimize:clear. Turned out there was an old "{any}" route still cached from before Breeze overwrote it.

1 like

Please or to participate in this conversation.