Page MenuHomePhabricator

D5351.diff
No OneTemporary

D5351.diff

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`
- <link
- rel="stylesheet"
- type="text/css"
- href="compiled/${assets.browser.css}"
- />
- `,
- };
- 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`
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="compiled/${assets.browser.css}"
+ />
+ `,
+ };
+ 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<LandingSSRProps>;
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`
- <link
- rel="stylesheet"
- type="text/css"
- href="compiled/${assets.browser.css}"
- />
- `,
- };
- 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`
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="compiled/${assets.browser.css}"
+ />
+ `,
+ };
+ 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;

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 12:04 PM (21 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611615
Default Alt Text
D5351.diff (2 KB)

Event Timeline