"@inertiajs/react": "^1.0.0",
"@vitejs/plugin-react": "^4.0.3",
LARAVEL v10.29.0
This issue just started happening. Test.jsx is in correct path, but pages[page] is undefined in the inertia-helpers. Any suggestions?
#path
resources
/js
/ Pages
/Test.jsx
#console error from app.jsx
laravel-vite-plugin_inertia-helpers.js?v=18a4faaf:5 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading './Pages/Test.jsx')
at resolvePageComponent (laravel-vite-plugin_inertia-helpers.js?v=18a4faaf:5:21)
at resolve (app.jsx:26:20)
at f2 (@inertiajs_react.js?v=18a4faaf:3681:143)
at U (@inertiajs_react.js?v=18a4faaf:3681:196)
at app.jsx:23:1
#web
Route::get('/test', function () {
return Inertia::render('Test');
})->name('test');
#app.jsx
import "./bootstrap";
import { createRoot } from "react-dom/client";
import { createInertiaApp } from "@inertiajs/react";
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
const appName = import.meta.env.VITE_APP_NAME || "App";
createInertiaApp({
title: (title) => `${title} - ${appName}`,
resolve: (name) => {
resolvePageComponent(`./Pages/Test.jsx`);
},
root.render(<div>test App.jsx</div>); },
});
#Test.jsx
import React, { useEffect } from "react";
const Test = () => {
useEffect(() => {}, []);
return <div>test Test.jsx</div>;
};
export default Test;