You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resolvePageComponent from Laravel Vite Plugin is throwing Page not found: ./Pages/undefined.tsx.
This means createInertiaApp calls the resolve function with name undefined.
This seems to happen when navigating to a page that stores a form's data and errors in the history state, using the rememberKey.
Steps to reproduce:
Create a new laravel app selecting the following options (I'm only showing possibly relevant ones here):
┌ Would you like to install a starter kit? ────────────────────┐
│ Laravel Breeze │
└──────────────────────────────────────────────────────────────┘
┌ Which Breeze stack would you like to install? ───────────────┐
│ React with Inertia │
└──────────────────────────────────────────────────────────────┘
┌ Would you like any optional features? ───────────────────────┐
│ Inertia SSR │
│ TypeScript │
└──────────────────────────────────────────────────────────────┘
Open resources/js/Pages/Auth/Login.tsx and add a rememberKey to the useForm hook on line 17:
const{ data, setData, post, processing, errors, reset }=useForm('login-form',{
Start your dev server php artisan serve and npm run dev
Go directly to http://localhost:8000/login.
Click to go back in your browser.
Click to go forward in your browser.
The following error is logged to console (But the page still loads):
laravel-vite-plugin_inertia-helpers.js?v=f3c759dc:12 Uncaught (in promise) Error: Page not found: ./Pages/undefined.tsx
at resolvePageComponent (laravel-vite-plugin_inertia-helpers.js?v=f3c759dc:12:9)
at resolve (app.tsx:14:16)
at C.l [as resolveComponent] (@inertiajs_react.js?v=ae425fca:3768:141)
at C.setPage (@inertiajs_react.js?v=ae425fca:3463:33)
at C.handleBackForwardVisit (@inertiajs_react.js?v=ae425fca:3361:52)
at C.init (@inertiajs_react.js?v=ae425fca:3318:167)
at @inertiajs_react.js?v=ae425fca:3756:8
at commitHookEffectListMount (chunk-PJEEZAML.js?v=c8d5d030:16915:34)
at commitPassiveMountOnFiber (chunk-PJEEZAML.js?v=c8d5d030:18156:19)
at commitPassiveMountEffects_complete (chunk-PJEEZAML.js?v=c8d5d030:18129:17)
Notes
This doesn't seem to happen when navigating using a Link component, but does if the user routes to that path directly (if you change the <Link> to an <a>, or type the URL of the page with the form in the search bar).
It only fails when navigating away and back to the page with the form, not on the initial page load.
It doesn't happen when the useForm hook doesn't have a rememberKey.
It doesn't seem to have any effect on the end-user experience 🤷 but the Sentry spam was enough for me to create this issue.
The text was updated successfully, but these errors were encountered:
Version:
@inertiajs/react
version: 1.2.0Describe the problem:
resolvePageComponent
from Laravel Vite Plugin is throwingPage not found: ./Pages/undefined.tsx
.This means
createInertiaApp
calls theresolve
function withname
undefined.This seems to happen when navigating to a page that stores a form's data and errors in the history state, using the
rememberKey
.Steps to reproduce:
resources/js/Pages/Auth/Login.tsx
and add arememberKey
to theuseForm
hook on line 17:php artisan serve
andnpm run dev
http://localhost:8000/login
.Notes
Link
component, but does if the user routes to that path directly (if you change the<Link>
to an<a>
, or type the URL of the page with the form in the search bar).useForm
hook doesn't have arememberKey
.The text was updated successfully, but these errors were encountered: