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

Bug: Straight webpack build (without watch) does not reach final state. #294

Closed
humorHan opened this issue Aug 28, 2019 · 11 comments · Fixed by #332
Closed

Bug: Straight webpack build (without watch) does not reach final state. #294

humorHan opened this issue Aug 28, 2019 · 11 comments · Fixed by #332

Comments

@humorHan
Copy link

image

@humorHan
Copy link
Author

always loading,because of the use of lerna

@ryan-roemer
Copy link
Member

Thanks for the report. Can you try two things to help us identify the issue:

  1. Can you report which version of the dashboard you're using? If 3.1.0 can you downgrade to 3.0.7 and report if that makes a difference?
  2. If the issue still persists, can you make a minimal GitHub repository with installation instructions and instructions of the commands you are running in the terminal with webpack-dashboard so that we can pull the repo and see what you are experiencing firsthand?

Thanks!

@yinshanyang
Copy link

I had a similar issue on 3.1.0 whilst programmatically calling webpack-dashboard (instead of the cli)

I have found that changing:

new DashboardPlugin(dashboard.setData)

to this:

new DashboardPlugin({ handler: dashboard.setData })

resolved the issue for me.

@tanrich
Copy link

tanrich commented May 18, 2021

@ryan-roemer Hello. I have the same problem. Is there a solution?

@tanrich
Copy link

tanrich commented May 18, 2021

@ryan-roemer Hello. I have the same problem. Is there a solution?

I found that downgrading to 3.0.7 is good.The latest version still has the problem.

@ryan-roemer
Copy link
Member

@tanrich I'm happy to jump in and diagnose if there's a reproduction. Can you make a minimal GitHub repository with installation instructions and instructions of the commands you are running in the terminal with webpack-dashboard so that we can pull the repo and see what you are experiencing firsthand?

@peterhpchen
Copy link

I had a similar issue on 3.3.3. After I downgraded to 3.2.1, it works fine.

Code: https://github.com/peterhpchen/book-webpack-examples/tree/develop/v4/27-production-analyze/dashboard-demo (It has issue after upgrade to 3.3.3)

Thank you.

@ryan-roemer
Copy link
Member

ryan-roemer commented Jul 10, 2021

Thanks @peterhpchen ! Verified an issue reproduction with your project. We'll dig in from here now that we have a repro.

Note that the screenshot I have below is not the original issue in that we don't have the (loading...) indicators, but your project does not reach actual modules / problems / etc. output and is stuck in Compiling phase.

Notes: From yarn build with this package.json:

  "scripts": {
    "build": "webpack-dashboard -- webpack"
  },
  "devDependencies": {
    "webpack": "^4.44.2",
    "webpack-cli": "^3.3.12",
    "webpack-dashboard": "^3.3.3"
  }

we get:

Screen Shot 2021-07-10 at 1 13 33 PM

@ryan-roemer ryan-roemer changed the title always loading Bug: Never reach final loaded state (webpack4) Jul 10, 2021
@ryan-roemer
Copy link
Member

On npm linking latest master I now get the (loading...) thing. Weird. At any rate, I'll keep digging...

Screen Shot 2021-07-10 at 1 20 30 PM

@peterhpchen
Copy link

Thanks, @ryan-roemer .

Just a reminder that webpack v5 has the same issue in 3.3.3.

Thank you.

@ryan-roemer
Copy link
Member

@peterhpchen -- On further inspection, one issue I'm noticing in the repo is that it's doing webpack and not webpack --watch or webpack-dev-server, which is just a single build and not something persistent.

I'm still going to investigate, but the following works just fine for yarn build:

diff --git a/v4/27-production-analyze/dashboard-demo/package.json b/v4/27-production-analyze/dashboard-demo/package.json
index 5963133..5139015 100644
--- a/v4/27-production-analyze/dashboard-demo/package.json
+++ b/v4/27-production-analyze/dashboard-demo/package.json
@@ -4,11 +4,11 @@
   "main": "index.js",
   "license": "MIT",
   "scripts": {
-    "build": "webpack-dashboard -- webpack"
+    "build": "webpack-dashboard -- webpack --watch"
   },
   "devDependencies": {
     "webpack": "^4.44.2",
     "webpack-cli": "^3.3.12",
-    "webpack-dashboard": "^3.2.1"
+    "webpack-dashboard": "^3.3.3"
   }
 }

@ryan-roemer ryan-roemer changed the title Bug: Never reach final loaded state (webpack4) Bug: Straight webpack build (without watch) does not reach final state. Jul 11, 2021
ryan-roemer added a commit that referenced this issue Jul 12, 2021
Refactors the plugin internal logic to be a lot simpler. 

- Chore: Refactor internal stats consumption to perform `inspectpack` analysis in the main thread, without using `main` streams. Originally, the `inspectpack` engine did some really heavy CPU stuff (gzipping lots of files), but now the actions are super fast, so I've removed `most` async observables and just switched to straight promises.
- Chore: Refactor internal handler in plugin to always be a wrapped function so that we can't accidentally have asynchronous code call the handler function after it is removed / nulled.
- Bugfix: Add message counting delayed cleanup in plugin to allow messages to drain in Dashboard. The issue seems to be that we hit socket IO disconnect in the plugin before the dashboard actually processes the messages. Fixes #294.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants