question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module federation Vue 2 with separate Vuetify and Vuex

See original GitHub issue

Hi,

I’m trying to create two Apps:

  1. Main app. It has Vue 2 with Vuex and Vue router.
  2. A standalone app with the same tech stack.

Right now I have a few problems. First of all the second app shows me store of the main app. I want them to have separate instaces of Vuex. Is there a way to do it? When I open the second app in browser everything is fine, but when it’s from the first app I have errors like: [vuex] unknown action type: appMF/sendData

Even though this action is known.

I think Vuetify is not also not loading properly since I got errors like that and it’s all working on url where this app is mounted. Cannot read properties of undefined (reading 'application').

I don’t want to have strictly written what Vue versions Remotes should have because some other apps will be using react, different techs and so on.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tomaszmaccommented, Jun 1, 2022

@tomaszmac i have done with a friend a example with vuetify working you can take a look here, in fact you need to instanciate the plugin on both.

About the vuex, once the vuex is “globa” on the window, the browser share its store. so if you dont want the second app to see the first store, you must use a differente namespace. Also so to the second store being “usable” on the shell you need to define de store on the first, export your store and register on the first.

Thanks a lot. Going to check this.

0reactions
schirrelcommented, Jun 1, 2022

About the vuex, once the vuex is “globa” on the window, the browser share its store. so if you dont want the second app to see the first store, you must use a differente namespace. Also so to the second store being “usable” on the shell you need to define de store on the first, export your store and register on the first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simplified Micro-Frontends in Vue | by Jack Herrington - Medium
Vue 3 is a fantastic platform for creating Micro-Frontend components. ... 5's Module Federation to share and consume Micro-FE components.
Read more >
Vuejs microfrontend with SystemJS / Vuetify - Stack Overflow
It's seem to be caused by a duplicated VueJS import (one by webpack, another with systemjs) but I'm not sure (I can access...
Read more >
Vue on Module Federation | Tutorial - YouTube
Learn how to share Vue components, Javascript and data live between applications using the Module Federation system built into Webpack 5.
Read more >
Live - Vue on Module Federation | Tutorial - YouTube
Learn how to share Vue components, Javascript and data live between applications using the Module Federation system built into Webpack 5.
Read more >
A curated list of awesome things related to Vue.js - GitHub
Vuetify Todo PWA - A simple Todo PWA built with Vue 2 + Vuex + Vuetify. ... PageKit - Modular and lightweight CMS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found