diff --git a/src/lib/content.js b/src/lib/content.js index 5b1c37a93..732429ba2 100644 --- a/src/lib/content.js +++ b/src/lib/content.js @@ -19,9 +19,11 @@ export function getContent([lang, name]) { if (!ext) url += '.md'; // In prod, never re-fetch the content (url is just a convenient compound cache key) - if (process.env.NODE_ENV === 'production' && url in CACHE) { - return CACHE[url]; - } + // if (process.env.NODE_ENV === 'production' && url in CACHE) { + // // eslint-disable-next-line no-console + // console.log(CACHE); + // return CACHE[url]; + // } let fallback = false; const res = fetch(url) @@ -45,6 +47,11 @@ export function getContent([lang, name]) { .then(data => { data.fallback = fallback; return data; + }) + .catch(err => { + // eslint-disable-next-line no-console + console.log(err); + CACHE[url] = undefined; }); return (CACHE[url] = res); } diff --git a/src/lib/hydrator.js b/src/lib/hydrator.js index 340346c75..b57d3e6bd 100644 --- a/src/lib/hydrator.js +++ b/src/lib/hydrator.js @@ -50,8 +50,9 @@ class Hydrator extends Component { _render(props) { const { Child } = this; // hydrate on first run, then normal renders thereafter - const doRender = process.env.NODE_ENV!=='production' || this.hydrated ? render : hydrate; - doRender( + const doRender = + process.env.NODE_ENV !== 'production' || this.hydrated ? render : hydrate; + render( ,