RonaldJerez / vue-input-facade

A lightweight and dependency free input masking library created specific for Vue
https://ronaldjerez.github.io/vue-input-facade/latest/
183 stars 27 forks source link

"A plugin must either be a function or an object with an "install" function." #30

Closed AmasaDelano closed 3 years ago

AmasaDelano commented 3 years ago

Describe the bug

I can't install this plugin.

To Reproduce

I included vue-input-facade like this in my code:

var inputFacade = require("vue-input-facade");

var app = Vue.createApp({ ... });

app.use(inputFacade);

When I run that, I get the following message in the browser's dev console:

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

These are my package.json dependencies:

"dependencies": {
    "jasmine": "^3.6.1",
    "jslint": "^0.12.1",
    "vue": "^3.0.5",
    "vue-input-facade": "^1.3.2",
    "webpack": "^4.44.1",
    "yaml": "^1.10.0",
    "yaml-import-loader": "^1.3.6"
}

Is this something I'm doing wrong on my end? Or is this is an issue with vue-input-facade?

Thanks!

RonaldJerez commented 3 years ago

Looks like you are using common js for your module. Depending on your transpiler you may need to access the default export manually. If you use es6 modules you won’t have that issue.