Skip to content

Commit

Permalink
fix: hmr do not crash on link without href (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored May 24, 2019
1 parent 0dafaf6 commit aa9b541
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hmr/hotModuleReplacement.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ function getCurrentScriptUrl(moduleId) {

function updateCss(el, url) {
if (!url) {
if (!el.href) {
return;
}

// eslint-disable-next-line
url = el.href.split('?')[0];
}
Expand Down Expand Up @@ -140,6 +144,10 @@ function reloadStyle(src) {
let loaded = false;

forEach.call(elements, (el) => {
if (!el.href) {
return;
}

const url = getReloadUrl(el.href, src);

if (!isUrlRequest(url)) {
Expand Down

0 comments on commit aa9b541

Please sign in to comment.