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.

hot module replacement dont work with absolute publicPath

See original GitHub issue

when hot updating the plugin takes the current protocol + host + port + publicPath + outputFilename

https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/blob/master/hotModuleReplacement.js#L3
https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/blob/master/hotModuleReplacement.js#L4

so the check in https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/blob/master/hotModuleReplacement.js#L13 oldChunk === newChunk is always false:

oldChunk = http://localhost:3011/dist/assets/Login
newChunk = http://localhost:3010http://localhost:3011/dist/assets/Login

when i comment out the origin it works

there could be a check for if the publicPath is an absolute one and just add the origin if its not

should i send i pr for this?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
lutzkcommented, Jul 16, 2017

yes looks like it would fix my issue but looks like if publicPath.match(/https?:/g) is false you lost the publicPath ? i left a comment at https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/pull/24/commits/c86dfac9e31dfaba00611e5bae362fe7633fc593 thank you

0reactions
faceyspaceycommented, Jul 17, 2017

@phyllisstein PR fixing this and related issues has been merged. yarn upgrade extract-css-chunks-webpack-plugin. Thanks again @phyllisstein !!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack-dev-server HMR not work when i add publicpath in ...
Just like title, when I add publicPath property in output, the HMR(Hot module replacement) not work, and when I remove it, It can...
Read more >
Public Path - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Hot Module Replacement - SymfonyCasts
It's not working! Webpack, AJAX and publicPath. Go to your browser's console, click the gear icon and check "Preserve logs". Thanks ...
Read more >
Webpack 5 Full Project Setup - YouTube
React Fast Refresh in Webpack: the new hot module loading tool supported ... I make to set environment variables will not work on...
Read more >
Webpack, Hot Module Replacement and the public path
But it does not work with HMR. It took me the good part of an afternoon to find out that Hot module replacement...
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