Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

How to use with Vue 2? #2

Open
luke-parallax opened this issue Aug 31, 2021 · 4 comments
Open

How to use with Vue 2? #2

luke-parallax opened this issue Aug 31, 2021 · 4 comments

Comments

@luke-parallax
Copy link

Hey,

I've tried making this work with Vue 2 using the following code as per the Inertia documentation:

import Vue from 'vue'
import { createInertiaApp } from '@inertiajs/inertia-vue'

createInertiaApp({
  resolve: name => require(`./Pages/${name}`),
  setup({ el, App, props }) {
    new Vue({
      render: h => h(App, props),
    }).$mount(el)
  },
})

But I'm seeing the following console error:

Uncaught (in promise) Error: Cannot find module './undefined'

I'm assuming this could be an issue where the statamic/inertia adapter isn't communicating the path for the components?

Thanks!

@luke-parallax
Copy link
Author

I'm also seeing this error when I try and follow the docs for Vue 3 - so I don't think it's related to Vue

@hotmeteor
Copy link
Owner

Are your views inside of a resources/js/Pages directory?

@luke-parallax
Copy link
Author

@hotmeteor Yes, my collection is called Pages and my Blueprint is called Homepage

I've tried resources/js/Pages/Homepage.vue & resources/js/Pages/Pages/Homepage.vue and both return the above error

@hotmeteor
Copy link
Owner

Hm. Can you share your app.js and Homepage.vue files?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants