intlify / vue-cli-plugin-i18n

:globe_with_meridians: Vue CLI plugin to add vue-i18n to your Vue Project
MIT License
195 stars 41 forks source link

Error with vuecli v5.0.0-beta.1 #205

Closed xibman closed 3 years ago

xibman commented 3 years ago

Hi all

Small error with last vue cli beta on option injection

The error on running app:

TypeError: Cannot read property 'i18n' of undefined TypeError: Cannot read property 'i18n' of undefined at module.exports (/Users/julien/taff/koala-claim/node_modules/vue-cli-plugin-i18n/index.js:13:29) at /Users/julien/taff/koala-claim/node_modules/@vue/cli-service/lib/Service.js:85:9 at Array.forEach () at loadedCallback (/Users/julien/taff/koala-claim/node_modules/@vue/cli-service/lib/Service.js:83:20) at Service.init (/Users/julien/taff/koala-claim/node_modules/@vue/cli-service/lib/Service.js:100:14) at Service.run (/Users/julien/taff/koala-claim/node_modules/@vue/cli-service/lib/Service.js:241:16) at Object. (/Users/julien/taff/koala-claim/node_modules/@vue/cli-service/bin/vue-cli-service.js:37:9) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32)

https://github.com/intlify/vue-cli-plugin-i18n/blob/1cdfbfea9aeeab18712e46f0b813ba47e105ce5f/index.js#L13

Code replacement :

const {
    enableInSFC,
    localeDir,
    runtimeOnly,
    enableLegacy,
    compositionOnly,
    fullInstall
  } = options
kazupon commented 3 years ago

Thank you for your reporting!

Sorry, I cannot catch up Vue CLI v5. I’ll try to support Vue CLI v5 later.

xibman commented 3 years ago

@kazupon Sorry My bad (error on my side)

Variiuz commented 2 years ago

@kazupon Sorry My bad (error on my side)

I'm having the same issue with the cli@4.5.15, what was your Issue?

xibman commented 2 years ago

@Variiuz if i remember don't forget to have this next entry into vue.config.js:


pluginOptions: {
    i18n: {
      //your options
    },
  },