From 01a92f3c2f81843105c33ca55c176348bcad79db Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Thu, 8 Feb 2018 08:58:44 -0800 Subject: [PATCH] asyncRequire: wrap result in default Reviewed By: cpojer Differential Revision: D6911464 fbshipit-source-id: 44953e0716e076e50d551738059435697d064733 --- packages/metro/src/lib/bundle-modules/asyncRequire.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/metro/src/lib/bundle-modules/asyncRequire.js b/packages/metro/src/lib/bundle-modules/asyncRequire.js index dd544eff..38c41cee 100644 --- a/packages/metro/src/lib/bundle-modules/asyncRequire.js +++ b/packages/metro/src/lib/bundle-modules/asyncRequire.js @@ -15,5 +15,5 @@ // eslint-disable-next-line flow-no-fixme const dynamicRequire = (require: $FlowFixMe); module.exports = function(moduleID: mixed): Promise { - return Promise.resolve(dynamicRequire(moduleID)); + return Promise.resolve().then(() => ({default: dynamicRequire(moduleID)})); };