Skip to content

Inertiajs TypeError upon page load #587

Open
@CyferZ

Description

@CyferZ

Hi guys,

I appreciate the hard work being done in this. Currently I'm making use of inertiajs/inertia-vue3 and inertiajs/inertia in my Laravel 8 project, and when I install this package and use the component, I get told the following in the console upon page load:
"Uncaught (in promise) TypeError: t._self is undefined"

The page is blank.

I made no changes to the app.js file aside from importing VueCarousel globally and then saying use(VueCarousel) under the createApp function, which works fine with other packages like SweetAlert.

This is where the delcaration happens:

import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/inertia-vue3';
import { InertiaProgress } from '@inertiajs/progress';

import VueCarousel from 'vue-carousel';

const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel';

createInertiaApp({
    title: (title) => `${title} - ${appName}`,
    resolve: (name) => require(`./Pages/${name}.vue`),
    setup({ el, app, props, plugin }) {
        return createApp({ render: () => h(app, props) })
            .use(plugin).use(VueCarousel)
            .mixin({ methods: { route } })
            .mount(el);
    },
});

Here are my dependencies in my package.json

"devDependencies": {
        "@inertiajs/inertia": "^0.10.0",
        "@inertiajs/inertia-vue3": "^0.5.1",
        "@inertiajs/progress": "^0.2.6",
        "@tailwindcss/forms": "^0.2.1",
        "@tailwindcss/typography": "^0.3.0",
        "@vue/compiler-sfc": "^3.0.5",
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "postcss-import": "^12.0.1",
        "tailwindcss": "^2.0.1",
        "vue": "^3.0.5",
        "vue-loader": "^16.1.2"
    },
    "dependencies": {
        "boxicons": "^2.0.9",
        "vue-carousel": "^0.18.0",
        "vue-sweetalert2": "^5.0.2",
        "vue-upload-drop-images": "^1.0.7",
        "vueperslides": "^3.3.2"
    }

Environment

  • Laravel ^8.54
  • Node/npm version: Node 14.17.0 & npm 7.17.0
  • OS: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions