Im not getting a compile error but an error in the browser console

Im sure its a silly newbie mistake.
This is what I have done.
laravel new inertial-examplecomposer require inertiajs/inertia-laravelwelcome.blade.php to app.blade.phpnpm install @inertiajs/inertia @inertiajs/inertia-vueresources/js/app.js (using the first one)import { InertiaApp } from '@inertiajs/inertia-vue'
import Vue from 'vue'
Vue.use(InertiaApp)
const app = document.getElementById('app')
new Vue({
render: h => h(InertiaApp, {
props: {
initialPage: JSON.parse(app.dataset.page),
resolveComponent: name => require(`./Pages/${name}`).default,
},
}),
}).$mount(app)
npm installnpm run watchnpm install --save vueMy routes and controllers
// Web.php
Route::get('/', [PagesController::class, 'index']);
// PagesController
use Inertia\Inertia;
class PagesController extends Controller
{
public function index()
{
echo 'index';
return Inertia::render('Pages/Home');
}
}
My vue pages is /resources/js/Pages/Home.vue
<template>
<div>
<h1>Welcome</h1>
<p>Hello World. Welcome to your first Inertia app!</p>
</div>
</template>
<script>
export default {
mounted() {
console.log('Component mounted.')
}
}
</script>
Pages doesn't need to be defined!
I can't tell what was wrong here, but it sounds like you got it figured out, so that's good! 馃
I was doing return Inertia::render('Pages/Home'); instead of return Inertia::render('Home');
:cry:
Oh right haha, obvious now that you say it. 馃槀
Most helpful comment
I was doing
return Inertia::render('Pages/Home');instead ofreturn Inertia::render('Home');:cry: