Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inertiajs TypeError upon page load #587

Open
CyferZ opened this issue Oct 12, 2021 · 0 comments
Open

Inertiajs TypeError upon page load #587

CyferZ opened this issue Oct 12, 2021 · 0 comments

Comments

@CyferZ
Copy link

CyferZ commented Oct 12, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant