Skip to content

Commit

Permalink
fix($errors): improve error messaging when no css hash found
Browse files Browse the repository at this point in the history
  • Loading branch information
faceyspacey committed Jul 7, 2017
1 parent 516cce6 commit 6e4cdda
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion importCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@

module.exports = function(chunkName) {
var href = getHref(chunkName)
if (!href) return
if (!href) {
if (process.env.NODE_ENV === 'development') {
if (typeof window === 'undefined' || !window.__CSS_CHUNKS__) {
console.warn(
'[DUAL-IMPORT] no css chunks hash found at "window.__CSS_CHUNKS__"'
)
return
}

console.warn(
'[DUAL-IMPORT] no chunk, ',
chunkName,
', found in "window.__CSS_CHUNKS__"'
)
}

return
}

var head = document.getElementsByTagName('head')[0]
var link = document.createElement('link')
Expand Down

0 comments on commit 6e4cdda

Please sign in to comment.