Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module federation throw error in HMR #138

Closed
ckken opened this issue Jun 30, 2020 · 10 comments
Closed

module federation throw error in HMR #138

ckken opened this issue Jun 30, 2020 · 10 comments

Comments

@ckken
Copy link

ckken commented Jun 30, 2020

pmmmwh/react-refresh-webpack-plugin#126 (comment)
WebHotelier/webpack-fast-refresh#5

@ScriptedAlchemy
Copy link
Member

beta 20?

@ckken
Copy link
Author

ckken commented Jun 30, 2020


beta 20?

yes

@ScriptedAlchemy
Copy link
Member

@jherr what are you using for HMR?

Worst case, live-reload works haha. I'll have to dig deeper. It might be good to post the issue here. Also, state how long its been an issue (beta 16?)

webpack/webpack#10352

@ScriptedAlchemy
Copy link
Member

Should be resolved

@ckken
Copy link
Author

ckken commented Jul 7, 2020

image
update webpack 5 beta 21

@ckken
Copy link
Author

ckken commented Jul 7, 2020

image
image

@shaodahong
Copy link

Still have

image

Version info

"webpack": "^5.0.0-beta.29",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",

Plugin config

      new ModuleFederationPlugin({
        name: APP_CONFIG.syscode,
        remotes,
        filename: 'remoteEntry.js',
        exposes: {
          './routes': './src/routes',
        },
      }),

@oschade
Copy link

oschade commented Dec 24, 2020

Still an issue for me with the same error as above. Here the critical content in my remoteEntry.js:

grafik

@vjsolanki
Copy link

any update this ?

I have created small sample to reproduce the error:
https://github.com/solankivj/fast-refresh-hmr-error

Error only come when i expose something

  1. Try running app after clone with npm start
  2. Edit something and save.
  3. Error will show in console
  4. Remove expose field from module_federation plugin and restart
  5. Now the error is gone but on save we get full page refresh

@zedford
Copy link

zedford commented Mar 25, 2021

I have this exact same issue that is only solved by not exposing anything in the ModuleFederationPlugin. Looks like cross-container support is on the roadmap:
#358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants