Installing vue plugins in ionic vue

Hey…

I am trying to install i18n plugin using the following command:

vue add i18n

the output:

 Installing vue-cli-plugin-i18n...


+ vue-cli-plugin-i18n@1.0.1
added 12 packages from 12 contributors in 45.29s

68 packages are looking for funding
  run `npm fund` for details       

✔  Successfully installed plugin: vue-cli-plugin-i18n

? The locale of project localization. ar
? The fallback locale of project localization. en
? The directory where store localization messages of project. It's stored under `src` directory. locales
? Enable locale messages in Single file components ? No

�  Invoking generator for vue-cli-plugin-i18n...
 ERROR  Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.
Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.
    at Collection.get (C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\jscodeshift\src\Collection.js:213:13)
    at injectOptions (C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\lib\util\codemods\injectOptions.js:15:6)    at runTransformation (C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\vue-codemod\dist\src\run-transformation.js:61:17)
    at C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:290:23
    at Array.forEach (<anonymous>)
    at Generator.resolveFiles (C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:276:24)       
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Generator.generate (C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:175:5)      
    at async runGenerator (C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:111:3)
    at async invoke (C:\Users\adela\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:92:3)

so I tried without success to install it manually but I always find it tricky to install plugins in vue (where and how should I import it)…

my questions is: How to install plugins in @ionic/vue ?

For Vue 3 you need https://github.com/intlify/vue-i18n-next

2 Likes

looks like the plugin I want to use (VueHammer) is not Vue 3 ready… is there a guide on migrating to Vue 3 for plugin developers?

after npm install and app.use(ViewHammer) I get

Argument of type 'typeof import("/home/sam/ionic/config/node_modules/@types/vue2-hammer/index")' is not assignable to parameter of type 'Plugin_2'.
[vue-cli-service]   Property 'install' is missing in type 'typeof import("/home/sam/ionic/config/node_modules/@types/vue2-hammer/index")' but required in type '{ install: PluginInstallFunction; }'.