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.

live reload broken (duplicate scripts like vendor.js appear)

See original GitHub issue

Reproduction: https://github.com/jacobq/embroider-live-reload-bug-repro

Enabling embroider in minimal (ember-cli v4.2.0) app breaks live reload feature. When ember s first gets run things are OK. However, changing a file (triggering update/reload) causes something weird to happen such that multiple vendor.js scripts appear (one gets added after each change/reload).

Compare link for v1.6.0 vs v1.7.1 (known good / bad): https://github.com/embroider-build/embroider/compare/v1.6.0...v1.7.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
krisseldencommented, May 31, 2022

I’m taking a look at this, thank you for the reproduction.

1reaction
jacobqcommented, Jun 1, 2022

Maybe somehow we’re re-adding the changed files each time?

I think I figured it out: when we cache/reuse the webpack instance (i.e. this.lastWebpack) we do not pass it the newly created HTMLEntrypoints (in appInfo), so the JSDOM instances held by the existing/previous webpack instance are getting used again (keeping the previously inserted content and then adding it again). The equalAppInfo doesn’t inspect the state of the entrypoints’ JSDOM instances

Read more comments on GitHub >

github_iconTop Results From Across the Web

HMR/Live Reloading broken after Webpack 5 rc.0 -> rc.1 update
Seems this issue happens when you have a browserslist entry in your package. json . Modules from ./node_modules/webpack-dev-server/client/ are ...
Read more >
Webpack devServer v. 4.x.x live reload not working
Below is the result of running the npm start script (the 2 files in ./src, index.js and the print.js, are copied from the...
Read more >
Why webpack-dev-server Live-Reload Is Not Working - Medium
When I modify javascript files, I have to manually run Webpack CLI to see changes to bundle.js in the local filesystem, and bundle.js...
Read more >
Handling common JavaScript problems - MDN Web Docs
For a start, the JavaScript console will report errors in your code. Make a local copy of our broken-ajax.html example (see the source...
Read more >
Code Splitting - webpack
Let's take a look at how we might split another module from the main bundle: project ... src/index.js and will thus be duplicated...
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