intlify / vue-i18n

Vue I18n for Vue 3

Home Page:https://vue-i18n.intlify.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using vuei18n-bridge gives error about using Composition API before functions

Lehren opened this issue · comments

Reporting a bug?

I followed the instructions for the Legacy API for version 2.6 in the migration guide.

But as soon as I open my app, I get an error:
[vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function.

Screenshot 2023-12-05 at 15 51 27

I tried poking around, and it seems it is caused by the import of createI18n , it also tries to use the file vue-composition-api.mjs to check for the installation of composition API, but my app will refer to vue-composition-api.common.js when calling Vue.use(VueCompositionAPI)

That might have something to do with it.

I already tried a fix I saw on Stackoverflow about moving the CompositionAPI import and Use to a different file, but that did not help.

Expected behavior

The migration guide to give correct working instructions

Reproduction

Have a Vue app on 2.6.
Install Dependencies
Try to perform the migration guide to install vue-i18n-bridge

System Info

System:
    OS: macOS 14.0
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 189.57 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
    npm: 6.14.8 - /usr/local/bin/npm
  Browsers:
    Chrome: 119.0.6045.199
    Firefox: 88.0.1
    Safari: 17.0
  npmPackages:
    @vue/composition-api: ^1.7.2 => 1.7.2 
    @vue/test-utils: ^1.0.0-beta.25 => 1.2.2 
    vue: ^2.6.14 => 2.6.14 
    vue-axios: ^3.5.2 => 3.5.2 
    vue-chartjs: ^4.1.2 => 4.1.2 
    vue-drag-drop: ^1.1.4 => 1.1.4 
    vue-i18n: ^8.26.1 => 8.26.1 
    vue-i18n-bridge: ^9.8.0 => 9.8.0 
    vue-loader: ^15.9.5 => 15.9.8 
    vue-material-design-icons: ^5.1.2 => 5.1.2 
    vue-modal-dialogs: ^3.0.0 => 3.0.0 
    vue-multiselect: ^2.1.6 => 2.1.6 
    vue-select: git+https://github.com/eriknygren/vue-select.git#3aec695 => 2.4.0 
    vue-template-compiler: ^2.6.14 => 2.6.14 
    vue3-click-away: ^1.2.4 => 1.2.4 
    vuedraggable: ^2.24.3 => 2.24.3

Screenshot

No response

Additional context

No response

Validations