From 3b97d0dd2a092239e7366549c8e44b56c9fdf063 Mon Sep 17 00:00:00 2001 From: Jonathan R Wickens Date: Tue, 26 Sep 2017 11:01:46 +0200 Subject: [PATCH 1/2] add development only console warn for tryRequire --- src/utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index cd8d654..4094267 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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(`There was an error while loading chunk: ${id}: ${err.message}`) + } + } return null } From 81c5af5eca5e347a30737c8131c936cae84b10df Mon Sep 17 00:00:00 2001 From: James Gillmore Date: Tue, 26 Sep 2017 02:23:06 -0700 Subject: [PATCH 2/2] fix($message): change console.warn messaging --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 4094267..24328b2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -26,7 +26,7 @@ export const tryRequire = (id: Id): ?any => { // 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(`There was an error while loading chunk: ${id}: ${err.message}`) + console.warn(`chunk not available for synchronous require yet: ${id}: ${err.message}`) } }