A plugin must either be a function or an object with an "install" function
See original GitHub issueDescribe the bug
I am not able to install the plugin. I receive a warning on the vue console in my browser.
[Vue warn]: A plugin must either be a function or an object with an "install" function.
To Reproduce
This is my main.js
import { createApp } from 'vue';
import { createRouter, createWebHistory } from 'vue-router';
import { ActionCableVue } from 'actioncable-vue';
import App from './App.vue';
import GameComponent from './components/GameComponent.vue';
import HomeComponent from './components/HomeComponent.vue';
const app = createApp(App)
const routes = [
{ path: '/home', component: HomeComponent },
{ path: '/game', component: GameComponent }
]
const router = createRouter({
mode: 'history',
history: createWebHistory(),
routes: routes
})
app.use(router)
app.use(ActionCableVue, {
debug: true,
debugLevel: 'error',
connectionUrl: 'ws://localhost:3000/api/cable',
connectImmediately: true,
})
app.mount('#app')
Expected behaviour
I would expect that $cable
is ready to use in my components.
Screenshots
This is a screenshot from the browser console
These are my used packages which includes the vue version
Plugin version: 2.3.2
Additional context I am new to vue and I am using the newest version of vue 3.0.0. The project is started fresh.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[Vue warn]:A plugin must either be a function or an object with ...
I use click-outside-vue3' as directive with Nuxt3. Had the same issue. The reason was that I had: import ClickOutside from ...
Read more >Plugins - Vue.js
A plugin is defined as either an object that exposes an install() method, or simply a function that acts as the install function...
Read more >[Vue warn]: A plugin must either be a function or an object with ...
Developers - [Vue warn]: A plugin must either be a function or an object with an "install" function. Vue test utils -
Read more >A plugin must either be a function or an object with an “install ...
A plugin must either be a function or an object with an “install “ function. 别说小李 于 2022-05-20 16:58:22 发布 339 收藏. 分类专栏:...
Read more >The Complete Guide to Vue 3 Plug-ins: Part 2 - CODE Magazine
This function accepts, as a first input, an object representing the plug-in and having an install() function. It also accepts a function ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@DenniJensen This plugin currently only supports Vue 2.0. I’ll look into adding Vue 3.0 support as soon as I can.
@docming @DenniJensen @timmaier Vue 3 support just went live thanks to #37. Kindly update to actioncable-vue 2.4.0.