Angular v19 module federation - Turning on webpack HMR throws loadShareSync failed error

Discussão em 'Angular' iniciado por vinnyo, Fevereiro 7, 2025.

  1. vinnyo

    vinnyo Guest

    I have an angular v19 app in a NX monorepo with module federation configured.

    I want to enable HMR for this project so I turned on the option in project.json file:

    "serve": {
    "executor": "@nx/angular:module-federation-dev-server",
    "options": {
    "port": 4200,
    "publicHost": "http://localhost:4200",
    "hmr": true // <-- turning on HMR
    },


    By doing this, I am getting the following error:

    [​IMG]

    Everything works when HMR is turned off. Anyone has any idea why this is happening? Or is this a simply case of module federation not supporting HMR?

    Here's a repo simulating this issue: https://github.com/vinnyo/nx-ng-dyn-fed

    Continue reading...

Compartilhe esta Página