question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack Dev Server doing everything twice

See original GitHub issue

Using freshly cloned copy of electron react boilerplate, I noticed in the logs that WDS logs seems to be called twice, for example: image

Prerequisites

  • [✓] Using yarn
  • [✓] Using node 10.x (v12.16.1)
  • [✓] Using an up-to-date master branch (commit hash 63cebabb467400c910acf51fa7a0b9285b7bff22)
  • [?] Using latest version of devtools. See wiki for howto update (I assume this is current since its freshly cloned, this url seems to be broken)
  • Link to stacktrace in a Gist (for bugs)
  • For issue in production release, devtools output of DEBUG_PROD=true yarn build && yarn start
  • Tried solutions mentioned in #400 (not an installation issue)

Expected Behavior

WDS should just do stuff like hot reloading and recompiling only once

Current Behavior

Webpack seems to be called twice, or have 2 instances or something, and seems to be recompiling every change twice. (see picture at top)

Possible Solution

I don’t really understand WDS but would like to learn more

Steps to Reproduce (for bugs)

  1. Git clone electron react boilerplate
  2. yarn
  3. yarn dev
  4. Look at dev console

Context

Not quite sure, but it seems like unintended behavior.

Yes but I did a fresh clone just to confirm that this wasn’t caused by our code.

Your Environment

  • Node version : v12.16.1
  • Version or Branch used : electron react boilerplate v1.1.0, git commit hash 63cebabb467400c910acf51fa7a0b9285b7bff22
  • Operating System and version : Microsoft Windows 10 Pro Version 10.0.18363 Build 18363
  • Link to your project : Not available

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
SergiiMarkincommented, Mar 11, 2022

Hi @amilajack This issue is still persisted image I run the fresh boilerplate and opened inspect window. As you see the above image, rendered twice time.

1reaction
steveetmcommented, Apr 25, 2020

I don’t think it should break anything, devServer configured as inline, so it should inject the necessary modules for HMR. Also, this method is mainly used when you instantiate webpack-dev-server via nodejs api (and legacy webpack maybe?) If you find anything broken please tell me.

However as I stated on PR, I closed it for now as there is other issue with HMR, I’ll fix that too and resend that when everything is cleaned up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack-dev-server runs twice - Stack Overflow
So right now, my theory is that for some reason webpack-dev-server is running twice, in parallel, and that creates a race condition or...
Read more >
Entry Points - webpack
In a multi-page application, the server is going to fetch a new HTML document for you. The page reloads this new document and...
Read more >
Kotlin js webpack-dev-server HMR reload twice
Hi, I followed this documentation. Everything is working, but if I change a kotlin source the page in the browser is reloaded twice:....
Read more >
webpack-dev-server
Using this config webpack-dev-server will serve the static files in your public folder. It'll watch your source files for changes and when changes...
Read more >
Parcel
Parcel includes a development server out of the box. Just run parcel index.html to get ... Everything is cached, so you never build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found