小编Jam*_*P27的帖子

Laravel 8 (Inertia js) - 获取 Vue 错误 'app.js:30559 [Vue 警告]:创建的钩子错误:“错误:找不到模块...”

我已经设置了一个使用 Jetstream(惯性 js 堆栈)的 Laravel 8 安装。Jetstream 提供的所有视图都正常工作。

问题是当我创建一个呈现新 Vue 模板的新路由时,我在控制台中收到此错误:

app.js:30559 [Vue warn]: Error in created hook: "Error: Cannot find module './Test'"

我在 web.php 中创建的路由

Route::get('/test', function() {
    return Inertia\Inertia::render('Test');
});
Run Code Online (Sandbox Code Playgroud)

“Test.vue”文件位于“resources/js/Pages”目录中。

<template>
            <h2 class="font-semibold text-xl text-gray-800 leading-tight">
                Testing
            </h2>
</template>
Run Code Online (Sandbox Code Playgroud)

应用程序.js

require('./bootstrap');

import Vue from 'vue';

import { InertiaApp } from '@inertiajs/inertia-vue';
import { InertiaForm } from 'laravel-jetstream';
import PortalVue from 'portal-vue';

Vue.use(InertiaApp);
Vue.use(InertiaForm);
Vue.use(PortalVue);

const app = document.getElementById('app');

new Vue({
    render: (h) =>
        h(InertiaApp, {
            props: …
Run Code Online (Sandbox Code Playgroud)

inertiajs laravel vue.js laravel-jetstream

3
推荐指数
2
解决办法
3929
查看次数

标签 统计

inertiajs ×1

laravel ×1

laravel-jetstream ×1

vue.js ×1