Hot reload doesn't work in 4.x with ModuleFederationPlugin
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- javascript, react
Piste de recherche
Clonez le dépôt microfrontend-hello-world lié, accédez à packages/helloReact et exécutez npm run start pour reproduire le comportement. Lisez App.js et la configuration de webpack, en particulier config/webpack.dev.js et la configuration de ModuleFederationPlugin ; c’est terminé lorsque les modifications du code source apparaissent dans le navigateur sans rechargement complet avec webpack-dev-server 4.x.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Bug report
Webpack dev server doesn't perform the hot reload properly in conjunction with ModuleFederationPlugin in v4.x but works in v3.x
Actual Behavior
When I set up a simple project using those dependencies:
{
"name": "test",
"version": "1.0.0",
"scripts": {
"start": "webpack serve --config=config/webpack.dev.js",
"build": "webpack --config=config/webpack.prod.js"
},
"dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0"
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"babel-loader": "^8.2.4",
"clean-webpack-plugin": "^4.0.0",
"html-webpack-plugin": "^5.5.0",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack-merge": "^5.8.0"
}
}
I manage to startup my application, I can't see any errors but when I update the source code, the update is not propagated into the browser and the change is visible ONLY after the full reload.
When I downgrade back to 3.x everything works smoothly.
I used this repository as reference: https://github.com/richardtbell/microfrontend-hello-world
Since this repository was quite older, I wanted to update to the latest version of all packages, the only issue I had was with the webpack-dev-server as I mentioned above.
Expected Behavior
A SPA is HOT reloaded as expected
How Do We Reproduce?
- Clone https://github.com/richardtbell/microfrontend-hello-world
- Go into
packages/helloReact - run: npm run start, update App.js, see the change in the browser is being propagated
- Update the dependencies with the snippet above.
- Do the same
- The change won't be visible, only after reload
- Try to downgrade the dev server to 3.x
- Everything will work
- OR: keep 4.x and remove the ModuleFederationPlugin from the webpack config and the hot reload will work again
Please paste the results of npx webpack-cli info here, and mention other relevant information
❯ npx webpack-cli info
System:
OS: macOS 12.3
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 29.45 MB / 16.00 GB
Binaries:
Node: 14.17.2 - ~/.nvm/versions/node/v14.17.2/bin/node
Yarn: 1.22.15 - ~/.yarn/bin/yarn
npm: 8.6.0 - ~/.nvm/versions/node/v14.17.2/bin/npm
Browsers:
Brave Browser: 99.1.36.119
Chrome: 100.0.4896.75
Safari: 15.4
Packages:
babel-loader: ^8.2.4 => 8.2.4
clean-webpack-plugin: ^4.0.0 => 4.0.0
html-webpack-plugin: ^5.5.0 => 5.5.0
webpack: ^5.71.0 => 5.72.0
webpack-cli: ^4.9.2 => 4.9.2
webpack-dev-server: ^4.8.1 => 4.8.1
webpack-merge: ^5.8.0 => 5.8.0
- Langage dominant
- JavaScript
- Étoiles
- 7.9k
- Forks
- 1.5k
- Merge moyen
- 2 j 12 h
- PR mergées (30 j)
- 8
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de webpack/webpack-dev-server
-
Add support for Chrome DevTools WorkspacesPeut-être à nouveau libre @AnumanyaJaiswal l’a pris il y a 35 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
webpack/webpack-dev-server#5716 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
webpack/webpack-dev-server#5679 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
CORS localhost requests are considered invalid host and get blockedPeut-être à nouveau libre @Jeston10 l’a pris il y a 310 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
webpack/webpack-dev-server#5603 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Webpack dev server URL should be displayed more prominentlyPeut-être pris @snitin315 l’a pris il y a 805 jours. Ouverte
webpack/webpack-dev-server#4907 · 7 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Pwa- Service worker not workOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
webpack/webpack-dev-server#4540 · 9 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de webpack/webpack-dev-server
Issues similaires
-
[bug] 提瓦特记事本原石检测框宽度较窄Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
babalae/bettergi-scripts-list#3905 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"Ouverte
Difficulté 1/5 1-3 heures Accessibilité débutants 87/100
dedicatedcode/reitti#1445 ·
Les mainteneurs répondent en général sous 1 jour
-
New tool: Uncle DeskPeut-être pris @github-actions l’a pris aujourd’hui. Ouvertesubmission triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
kausalflow/tools#384 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Add spaced repetition schedulingOuvertegood first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
-
Fuzz: css syntax bug foundOuvertearea: css
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour