error on incorrect init args

This commit is contained in:
Rich Harris
2018-05-04 23:06:10 -04:00
parent 8ee5346900
commit 3becc1cbe2
2 changed files with 8 additions and 0 deletions

View File

@@ -54,6 +54,10 @@ export default function middleware({ App, routes, store }: {
routes: RouteObject[],
store: (req: Req) => Store
}) {
if (!App) {
throw new Error(`As of 0.12, you must supply an App component to Sapper — see https://sapper.svelte.technology/guide#0-11-to-0-12 for more information`);
}
const output = locations.dest();
const client_info = JSON.parse(fs.readFileSync(path.join(output, 'client_info.json'), 'utf-8'));