Service in Federation Module

UI Components for Vue
Post Reply
kitaone
Posts: 1
Joined: 07 Jun 2023, 21:00

12 Sep 2023, 01:25

Hello when i use any service this works in a normal app. But if i want to split them via federation module i always get the message that a service i not registered.

Code: Select all

import ConfirmationService from 'primevue/confirmationservice';
import DialogService from 'primevue/dialogservice';
import FocusTrap from 'primevue/focustrap';
import Ripple from 'primevue/ripple';
import StyleClass from 'primevue/styleclass';
import ToastService from 'primevue/toastservice';
import Tooltip from 'primevue/tooltip';

import PrimeVue from "primevue/config";
...
const app = createApp(App);
app
  .use(pinia)
  .use(DialogService)
  .use(ConfirmationService)
  .use(ToastService)
  .use(PrimeVue, { ripple: true })
Error: No PrimeVue Dialog provided!
at s (usedialog.esm-969b7452.js:1:194)

or

Error: No PrimeVue Confirmation provided!
at a (confirmationeventbus.esm-0b5d6c5d.js:1:186)

i also tried it to put it in the "shared"

here my vite.config.ts
Module:

Code: Select all

  plugins: [

    vue(),
    federation({
      name: 'client_employee',
      filename: 'employee_remote.js',
      // Modules to expose
      exposes: {
        // "./EmployeeView": "./src/views/EmployeeView.vue",
        // "./EmployeeList": "./src/views/EmployeeList.vue",
        // "./CreateEmployee": "./src/views/CreateEmployee.vue",
        './ModuleConfig': './src/ModuleConfig.vue',
      },
      shared: ['vue', 'pinia', "vue-router", "axios",
      'primevue/config',
      'primevue/toastservice',
      'primevue/dialogservice',
      'primevue/confirmationservice',]
    })
  ],
MainApp:

Code: Select all

  plugins: [
    vue(),
    federation({
      name: 'k1-main',
      filename: 'empty_remote.js',
      exposes: {
        './ModuleConfig': './src/EmptyModuleConfig.vue',
      },
      remotes: {
        client_employee: {
          external: generateFetch((isDev() ? "http://localhost:8082" : "/employee") + "/assets/employee_remote.js"),
          externalType: 'promise'
        },
      },
      shared: ['vue', 'pinia', "vue-router", "axios",
      'primevue/config',
      'primevue/toastservice',
      'primevue/dialogservice',
      'primevue/confirmationservice',
    ]
    })
  ],
what do i miss?

thank you
Christian

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests