Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davestar057's avatar

Using VUE plugins with JetStream (Laravel/Inertia)

Hi, I am trying to add a VUE package to my laravel jetstream using Laravel/Inertia. The package requires adding the following to the main JS file

import wysiwyg from "vue-wysiwyg"; Vue.use(wysiwyg, {}); // config is optional. more below

Which is causing the error in the terminal Uncaught ReferenceError: Vue is not defined

Obviously I can see Vue is not defined as usual with the jetstream setup - I am just wondering how I achieve this? I am sure I am missing something simple/obvious - but new to this setup and wondering if anybody can shed any light on this?

0 likes
8 replies
tykus's avatar

Using the composition API, you use plugins on the created App instance, e.g.

return createApp({ render: () => h(app, props) })
  .use(wysiwyg)
  // ...
1 like
davestar057's avatar

Thanks for your reply - excuse my ignorance, but how would that work with the jetpack setup? trying import/use 'wysiwyg'?? thanks for your help

require('./bootstrap');

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

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) .mixin({ methods: { route } }) .mount(el); },

});

InertiaProgress.init({ color: '#4B5563' });

tykus's avatar
tykus
Best Answer
Level 104

Just looking at that vue-wysiwyg package on npm, it is 3 years since it was published; will it even work with Vue3???

1 like
davestar057's avatar

probs where im going wrong - lol - thanks for your help though all the same

tykus's avatar

Did you follow the Vue3 guide; it worked for me as a quick test on a current project?

tykus's avatar

@davestar057 that's it - it is working; but, it is headless meaning

There is no provided user interface, you are absolutely free to build whatever interface you want.

You need to construct the Editor design and controls to suit your project, e.g. https://www.tiptap.dev/examples/default

Please or to participate in this conversation.