Skip to content

How to use vue-rx with spring boot admin and Vue3? Error: "  vue-rx.esm.js:310 Uncaught TypeError: Vue.use is not a function" #3174

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

Closed
kormosp opened this issue Feb 19, 2024 · 1 comment

Comments

@kormosp
Copy link

kormosp commented Feb 19, 2024

Hi,
Can you please help in how to import and use vue-rx with spring biit admin ui components? I always run into errors.
I am a beginner, the application worked in Vue2 and earlier version of Spring Boot Admin. Now in Vue3 it does not.
When I try to add add something with 'use' in index.js, I get the error "Vue.use is not a function"

package.json :

"vue": "^3.4.19",
"rxjs": "^6.6.7",
"vue-rx": "^6.2.0",
"vuex": "^4.1.0"

"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"@vue-macros/reactivity-transform": "^0.4.3",
"@vue/compiler-sfc": "^3.4.19",
"vite": "5.1.1",
"vite-plugin-static-copy": "^1.0.1"
},
import { createApp } from 'vue';
import Vue from 'vue';
import VueRx from 'vue-rx';

SBA.use({
  install({viewRegistry}) {
    const app = createApp(custom); 
     app.use(VueRx);
    app.mount('#app')

    viewRegistry.addView({
      name:   'instances/custom',
      parent: 'instances',
      path:   'custom',
      component: customEndpoint,
      label: 'GSLA-Cloud Streams',
      group: 'custom',  //Group
      order: -10,                   // Orig: 1000
      isEnabled: ({ instance }) => {
        return instance.hasEndpoint("custom");},
    });
  }
});

The error:

vue-rx.esm.js:310 Uncaught TypeError: Vue.use is not a function
    at vue-rx.esm.js:310:7
    at custom-ui.js:2:241
    at custom-ui.js:3:3

I tried to import it in the component too, but I did not manage to make it work.
Thank you for your help!
Peter

@SteKoe
Copy link
Contributor

SteKoe commented Feb 21, 2024

Hi @kormosp,

as far as I can see, it is not compatible (i.e. vuejs/vue-rx#148).

Regards,
SteKoe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants