diff --git a/keyserver/src/responders/landing-handler.js b/keyserver/src/responders/landing-handler.js
--- a/keyserver/src/responders/landing-handler.js
+++ b/keyserver/src/responders/landing-handler.js
@@ -59,20 +59,27 @@
};
return assetInfo;
}
- // $FlowFixMe landing/dist doesn't always exist
- const { default: assets } = await import('landing/dist/assets');
- assetInfo = {
- jsURL: `compiled/${assets.browser.js}`,
- fontURLs: [googleFontsURL, iaDuoFontsURL],
- cssInclude: html`
-
- `,
- };
- return assetInfo;
+ try {
+ // $FlowFixMe landing/dist doesn't always exist
+ const { default: assets } = await import('landing/dist/assets');
+ assetInfo = {
+ jsURL: `compiled/${assets.browser.js}`,
+ fontURLs: [googleFontsURL, iaDuoFontsURL],
+ cssInclude: html`
+
+ `,
+ };
+ return assetInfo;
+ } catch {
+ throw new Error(
+ 'Could not load assets.json for landing build. ' +
+ 'Did you forget to run `yarn dev` in the landing folder?',
+ );
+ }
}
type LandingApp = React.ComponentType;
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js
--- a/keyserver/src/responders/website-responders.js
+++ b/keyserver/src/responders/website-responders.js
@@ -81,20 +81,27 @@
};
return assetInfo;
}
- // $FlowFixMe web/dist doesn't always exist
- const { default: assets } = await import('web/dist/assets');
- assetInfo = {
- jsURL: `compiled/${assets.browser.js}`,
- fontsURL: googleFontsURL,
- cssInclude: html`
-
- `,
- };
- return assetInfo;
+ try {
+ // $FlowFixMe web/dist doesn't always exist
+ const { default: assets } = await import('web/dist/assets');
+ assetInfo = {
+ jsURL: `compiled/${assets.browser.js}`,
+ fontsURL: googleFontsURL,
+ cssInclude: html`
+
+ `,
+ };
+ return assetInfo;
+ } catch {
+ throw new Error(
+ 'Could not load assets.json for web build. ' +
+ 'Did you forget to run `yarn dev` in the web folder?',
+ );
+ }
}
let webpackCompiledRootComponent: ?React.ComponentType<{}> = null;