Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3401429
D5351.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D5351.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5351: [keyserver] Add descriptive error if assets.json can't be found
Attached
Detach File
Event Timeline
Log In to Comment