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

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

Closed
t8rn8r opened this issue Oct 29, 2022 · 4 comments

Comments

@t8rn8r
Copy link

t8rn8r commented Oct 29, 2022

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> 
@syropian
Copy link
Owner

syropian commented Oct 29, 2022

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

@syropian
Copy link
Owner

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

@t8rn8r
Copy link
Author

t8rn8r commented Oct 30, 2022

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!

@t8rn8r t8rn8r closed this as completed Oct 30, 2022
@syropian
Copy link
Owner

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

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

2 participants