syropian/vue-input-autowidth

[Vue warn]: A plugin must either be a function or an object with an "install" function.

t8rn8r opened this issue · 4 comments

Thank you for making this great plugin!

I believe I've followed your instructions for installation and usage on the v2 branch, but get [Vue warn]: A plugin must either be a function or an object with an "install" function. when I try to use it.

For your reference, here's my main.js:

import { createApp } from "vue";
import { plugin as VueInputAutowidth } from 'vue-input-autowidth';

import App from "./App.vue";
import router from "./router";

import "./assets/main.css";

const app = createApp(App);

app.use(VueInputAutowidth); // this is the line with the warning
app.use(router);

app.mount("#app");

This problem seems to prevent me from using your plugin. I attempt to use it in a component I get:

[Vue warn]: Failed to resolve directive: autowidth 
  at <HomeView onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView> 
  at <App> 

Hi! That definitely doesn't sound correct, I will take a look at this tomorrow and see what I can do 👍🏻

Hey @t8rn8r, I made a quick attempt at reproducing the issue in a StackBlitz but couldn't replicate the problem — https://stackblitz.com/edit/vue-6pvmgg?file=src/main.js

Are you sure you're on the correct version? I believe it should (at time of writing) resolve to 2.2.0

Thank you for the quick reply, @syropian!

I was, in fact, using the correct version of autowidth. I just needed to update all my other packages!

I'm so sorry to take your time. Keep up the great work!

Glad you got it sorted, thanks for letting me know!