Skip to content

Commit

Permalink
Merge pull request #55 from jwickens/patch-1
Browse files Browse the repository at this point in the history
add development only console warn for tryRequire
  • Loading branch information
faceyspacey authored Sep 26, 2017
2 parents 9a1a1cf + 81c5af5 commit 49afd2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ export const tryRequire = (id: Id): ?any => {
try {
return requireById(id)
}
catch (err) {}
catch (err) {
// warn if there was an error while requiring the chunk during development
// this can sometimes lead the server to render the loading component.
if (process.env.NODE_ENV === 'development') {
console.warn(`chunk not available for synchronous require yet: ${id}: ${err.message}`)
}
}

return null
}
Expand Down

0 comments on commit 49afd2b

Please sign in to comment.