Hot reload doesn't work in 4.x with ModuleFederationPlugin
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, react
Hướng nghiên cứu
Clone repository microfrontend-hello-world được liên kết, truy cập packages/helloReact và chạy npm run start để tái hiện hành vi. Đọc App.js và cấu hình webpack, đặc biệt là config/webpack.dev.js và phần thiết lập ModuleFederationPlugin; công việc được xem là hoàn tất khi các thay đổi mã nguồn xuất hiện trong trình duyệt mà không cần tải lại toàn bộ khi sử dụng webpack-dev-server 4.x.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 7.9k
- Fork
- 1.5k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của webpack/webpack-dev-server
-
Add support for Chrome DevTools WorkspacesCó thể làm lại được @AnumanyaJaiswal đã nhận 35 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
webpack/webpack-dev-server#5716 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
webpack/webpack-dev-server#5679 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CORS localhost requests are considered invalid host and get blockedCó thể làm lại được @Jeston10 đã nhận 310 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
webpack/webpack-dev-server#5603 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Webpack dev server URL should be displayed more prominentlyCó thể đã có người làm @snitin315 đã nhận 805 ngày trước. Đang mở
webpack/webpack-dev-server#4907 · 7 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Pwa- Service worker not workĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
webpack/webpack-dev-server#4540 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của webpack/webpack-dev-server
Issue tương tự
-
[bug] 提瓦特记事本原石检测框宽度较窄Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
babalae/bettergi-scripts-list#3905 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
dedicatedcode/reitti#1445 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
New tool: Uncle DeskCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mởsubmission triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
kausalflow/tools#384 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add spaced repetition schedulingĐang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Fuzz: css syntax bug foundĐang mởarea: css
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày