Ok. Can you show the manifest.json? How are you loading that file? Is it a php or javascript error?
Unable to locate file in Vite manifest
Unable to locate file in Vite manifest: resources/js/Pages/Reservation/Create.vue.
I am getting this error after running npm run build. And it happens only when I refresh the page. If I am on the Index.vue and in that page if I click the inertia link to visit the Create.vue it works but once I am there and I refresh then I get the error above.
@Sinnbeck I am reaching the controller when I click or refresh but the error is happening only in the following
return Inertia::render('Reservation/Create', [
'arrivalDate' => $date->format('Y-m-d'),
'arrivalTime' => Carbon::createFromTime(14, 0, 0)->format('H:i'),
'departureDate' => $date->addDay()->format('Y-m-d'),
]);
manifest.json
{
"resources/js/app.css": {
"file": "assets/app-6761b071.css",
"src": "resources/js/app.css"
},
"resources/js/Pages/Auth/ResetPassword.vue": {
"file": "assets/ResetPassword-a1669f65.js",
"src": "resources/js/Pages/Auth/ResetPassword.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_GuestLayout-1b9544b3.js",
"_InputLabel-6783fa36.js",
"_PrimaryButton-26150084.js",
"_TextInput-267f067d.js",
"__plugin-vue_export-helper-c27b6911.js"
]
},
"resources/js/Pages/Auth/Login.vue": {
"file": "assets/Login-00fef38f.js",
"src": "resources/js/Pages/Auth/Login.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_InputLabel-6783fa36.js",
"_PrimaryButton-26150084.js",
"_TextInput-267f067d.js",
"_GuestLayout-1b9544b3.js",
"__plugin-vue_export-helper-c27b6911.js"
]
},
"_GuestLayout-1b9544b3.js": {
"file": "assets/GuestLayout-1b9544b3.js",
"imports": [
"__plugin-vue_export-helper-c27b6911.js",
"resources/js/app.js"
]
},
"resources/js/Pages/Auth/ForgotPassword.vue": {
"file": "assets/ForgotPassword-c925d492.js",
"src": "resources/js/Pages/Auth/ForgotPassword.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_GuestLayout-1b9544b3.js",
"_InputLabel-6783fa36.js",
"_PrimaryButton-26150084.js",
"_TextInput-267f067d.js",
"__plugin-vue_export-helper-c27b6911.js"
]
},
"resources/js/Pages/Profile/Edit.vue": {
"file": "assets/Edit-0559cfb1.js",
"src": "resources/js/Pages/Profile/Edit.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"resources/js/Pages/Profile/Partials/DeleteUserForm.vue",
"resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue",
"resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue",
"_InputLabel-6783fa36.js",
"_TextInput-267f067d.js",
"_PrimaryButton-26150084.js"
]
},
"resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue": {
"file": "assets/UpdateProfileInformationForm-3cbc285a.js",
"src": "resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_InputLabel-6783fa36.js",
"_PrimaryButton-26150084.js",
"_TextInput-267f067d.js"
]
},
"resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue": {
"file": "assets/UpdatePasswordForm-8b7b2ad7.js",
"src": "resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_InputLabel-6783fa36.js",
"_PrimaryButton-26150084.js",
"_TextInput-267f067d.js"
]
},
"__plugin-vue_export-helper-c27b6911.js": {
"file": "assets/_plugin-vue_export-helper-c27b6911.js"
},
"_PrimaryButton-26150084.js": {
"file": "assets/PrimaryButton-26150084.js",
"imports": [
"resources/js/app.js"
]
},
"resources/js/Pages/Profile/Partials/DeleteUserForm.vue": {
"file": "assets/DeleteUserForm-ccf8fca8.js",
"src": "resources/js/Pages/Profile/Partials/DeleteUserForm.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_InputLabel-6783fa36.js",
"_TextInput-267f067d.js"
]
},
"_TextInput-267f067d.js": {
"file": "assets/TextInput-267f067d.js",
"imports": [
"resources/js/app.js"
]
},
"resources/js/Pages/Auth/ConfirmPassword.vue": {
"file": "assets/ConfirmPassword-777dcf9d.js",
"src": "resources/js/Pages/Auth/ConfirmPassword.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_GuestLayout-1b9544b3.js",
"_InputLabel-6783fa36.js",
"_PrimaryButton-26150084.js",
"_TextInput-267f067d.js",
"__plugin-vue_export-helper-c27b6911.js"
]
},
"resources/js/Pages/Auth/VerifyEmail.vue": {
"file": "assets/VerifyEmail-8d167b97.js",
"src": "resources/js/Pages/Auth/VerifyEmail.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_GuestLayout-1b9544b3.js",
"_PrimaryButton-26150084.js",
"__plugin-vue_export-helper-c27b6911.js"
]
},
"_InputLabel-6783fa36.js": {
"file": "assets/InputLabel-6783fa36.js",
"imports": [
"resources/js/app.js"
]
},
"resources/js/Pages/Auth/Register.vue": {
"file": "assets/Register-01e96179.js",
"src": "resources/js/Pages/Auth/Register.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_GuestLayout-1b9544b3.js",
"_InputLabel-6783fa36.js",
"_PrimaryButton-26150084.js",
"_TextInput-267f067d.js",
"__plugin-vue_export-helper-c27b6911.js"
]
},
"resources/js/Pages/Welcome.vue": {
"file": "assets/Welcome-ddfbfa2e.js",
"src": "resources/js/Pages/Welcome.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js"
]
},
"_Create-3c2a8d75.js": {
"file": "assets/Create-3c2a8d75.js",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"__plugin-vue_export-helper-c27b6911.js",
"_TextInput-267f067d.js",
"_PrimaryButton-26150084.js"
]
},
"resources/js/Pages/Reservation/Index.vue": {
"file": "assets/Index-de882033.js",
"src": "resources/js/Pages/Reservation/Index.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_Create-3c2a8d75.js",
"__plugin-vue_export-helper-c27b6911.js",
"_TextInput-267f067d.js",
"_PrimaryButton-26150084.js"
]
},
"resources/js/app.js": {
"file": "assets/app-8ee4d5d7.js",
"src": "resources/js/app.js",
"isEntry": true,
"dynamicImports": [
"resources/js/Pages/Auth/ConfirmPassword.vue",
"resources/js/Pages/Auth/ForgotPassword.vue",
"resources/js/Pages/Auth/Login.vue",
"resources/js/Pages/Auth/Register.vue",
"resources/js/Pages/Auth/ResetPassword.vue",
"resources/js/Pages/Auth/VerifyEmail.vue",
"resources/js/Pages/Profile/Edit.vue",
"resources/js/Pages/Profile/Partials/DeleteUserForm.vue",
"resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue",
"resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue",
"_Create-3c2a8d75.js",
"resources/js/Pages/Reservation/Index.vue",
"resources/js/Pages/Welcome.vue"
],
"css": [
"assets/app-6761b071.css"
]
}
}
@Zayar I don't see that file. Are you sure it's commited to git and pushed?
@Sinnbeck Yes the file is missing from the manifest.json, but the file is there, it also loads when I run npm run dev.
@Zayar we need to know more. Show your app.vue please
From the looks of it, it seems that Reservation/Create.vue is used as an import for Reservation/Index.vue. That could be why it's not working as expected. 🤷♂️ What does your code look like?
"resources/js/Pages/Reservation/Index.vue": {
"file": "assets/Index-de882033.js",
"src": "resources/js/Pages/Reservation/Index.vue",
"isDynamicEntry": true,
"imports": [
"resources/js/app.js",
"_Create-3c2a8d75.js", // Not its own Inertia page.
"__plugin-vue_export-helper-c27b6911.js",
"_TextInput-267f067d.js",
"_PrimaryButton-26150084.js"
]
},
@thinkverse I think you right. I may have forgotten to remove the import in Index.vue file. I will give it a try...
I have a similar problem. When I am in DEV mode there are no errors and everything works normally, after carrying out the BUILD there is a page that produces a 500 error on page reload(cmd+R) but it works normally if I open the page from the link in the menu; this happens because the entry relating to the vue file of the page is missing in the manifest.json file. After some tests I realized that removing the import for the chartjs-plugin-datalabels plugin and the references in the graphs present on the page, the manifest.json file also correctly contains the reference to the vue page in question and everything starts to work correctly. Some idea?
I also have same problem with react, is there any solution?"
For anyone having this problem, I found that somehow, when a new Laravel project is installed and the Breeze installer is run, in the app.blade.php the following Vite call is set:
<!-- Scripts -->
@routes
@vite(['resources/js/app.js', "resources/js/Pages/{$page['component']}.vue"])
{{-- @vite(['resources/css/app.css'])--}}
@inertiaHead
While this works on the local environment, with the Vite server running, in production, where the app relies on the vite manifest to locate and load the assets, the correct @vite call is:
@vite(['resources/js/app.js'])
This is because by default the vite manifest just contains the built app.js file, which contains all the Vue Pages and components.
Hope this helps. Just spent about an hour trying to figure this out.
@antoniocusro This helped me, thanks very much!!
@antoniocusro It worked for me! Thank you!
@antoniocusro thank you for this! the error was incomprehensible :)
I had the same problem, after some experimentation i found the problem.
In my case what the app.ts file where i was setting a default layout. I was using the config that was in the docs.
After some research i found this other way to set a deafult layout and after using it and building the app I had no problemas
Here is the code:
resolve: (name) => {
const page = resolvePageComponent(
`./Pages/${name}.vue`,
import.meta.glob<DefineComponent>('./Pages/**/*.vue'),
);
page.then((p) => {
p.default.layout = p.default?.layout || MainLayout;
});
return page;
},
Please or to participate in this conversation.