From 9d6f7b28281b6a677c4686b613ff450e8a9be6fb Mon Sep 17 00:00:00 2001 From: Alvis HT Tang Date: Thu, 26 Apr 2018 19:18:49 +0100 Subject: [PATCH] fix: make babel-polyfill working see https://github.com/gatsbyjs/gatsby/issues/2177 --- gatsby-browser.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gatsby-browser.tsx b/gatsby-browser.tsx index 9c25939..ee98bdd 100644 --- a/gatsby-browser.tsx +++ b/gatsby-browser.tsx @@ -17,9 +17,18 @@ * ------------------------------------------------------------------------- */ -// import Browser from '#definitions/gatsby/browser'; +import 'babel-polyfill'; -// export const onClientEntry: Browser.onClientEntry = (): void => {}; +import Browser from '#definitions/gatsby/browser'; + +/* + * onClientEntry is required for the polyfill to be loaded + * see https://github.com/gatsbyjs/gatsby/issues/2177 + */ +export const onClientEntry: Browser.onClientEntry = (): void => { + // no need to do anything here, but if you don't + // export something, the import won't work. +}; // export const onInitialClientRender: Browser.onInitialClientRender = (): void => {};