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

@kormosp

Description

@kormosp

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions