From 860099fe18d306a1af85cc7e8a17a8a056d145d8 Mon Sep 17 00:00:00 2001 From: "REDMOND\\acoates" Date: Fri, 10 May 2019 14:32:15 -0700 Subject: [PATCH] Check build has happened before running bundler --- vnext/rn-cli.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vnext/rn-cli.config.js b/vnext/rn-cli.config.js index 7b78e28723c..7c3a8500272 100644 --- a/vnext/rn-cli.config.js +++ b/vnext/rn-cli.config.js @@ -56,5 +56,10 @@ if (fs.existsSync(path.resolve(__dirname, '../../scripts/metro-resources.js'))) config.resolver.extraNodeModules['SnapshotViewIOS'] = path.resolve(__dirname, 'Libraries/RCTTest/SnapshotViewIOS'); config.resolver.hasteImplModulePath = path.resolve(__dirname, 'jest/hasteImpl.js'); +// Check that we have built our JS files before running the bundler, otherwise we'll get a harder to diagnose "Unable to resolve module" error +if (!fs.existsSync(path.resolve(__dirname, 'lib/Libraries/Components/AccessibilityInfo/AccessibilityInfo.uwp.js'))) { + throw new Error(`\nThis package must be built before running the bundler. Did you mean to run "yarn build" first?\n`); +} + module.exports = config;