phoenix-ru/nuxt3-module-federation-example

Question about the nuxt3 dependencies

Closed this issue · 5 comments

Hi,

Sorry I'm contacting you through GitHub issues and it's not the right media but I didn't know how to do otherwise.

In this repo, it's works perfectly and you use the following dependencies

  "devDependencies": {
    "@telenko/node-mf": "^0.0.5",
    "nuxt3": "^3.0.0-27374259.21b664c",
    "rimraf": "^3.0.2",
    "webpack": "^5.59.1"
  }

I was surprised by the "nuxt3". In the nuxt3 documentation the dependency is :

"nuxt": "^3.0.0-rc.8",

And with this dependency, this project don't work anymore (even if you change the nuxt.config.ts accordingly)

I don't really get it, on npm there is no description of nuxt and nuxt3 package except a vague description "The core of Nuxt 3"

Do you know what is the difference between the two (and why it don't work with the official version referenced in the documentation for nuxt3) ?

This project was created when Nuxt was still in Beta. And since now it's RC, you should indeed use RC.

Most likely, you need to add (as per nuxt/framework#3375):

export default defineNuxtConfig({
  experimental: {
    asyncEntry: true // or process.env.NODE_ENV !== 'development'
  }
})

This PR in the framework reverted the change I did and marked it as "experimental"

I may update the example in my spare time

I see there is also a new plugin for vite : https://github.com/originjs/vite-plugin-federation

I'll investigate with this plugin because keeping vite would be nice :)

Again, thanks a lot for your help and your demonstration code.

@hlassiege Any news using vite?

Hi,
Yes, we have an example here : https://gitlab.com/maltcommunity/public/singapore-prototypes/-/tree/master/micro-frontend
However, the implementation is not optimal because of this issue : originjs/vite-plugin-federation#239
For the moment there is no satisfactory solution