From 2ffc31a7c6e174506392461b2f205933c8368911 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 14 Jun 2016 11:35:12 +0100 Subject: [PATCH] In ReactReduxSpa template, better report failure to match client-side routes --- templates/ReactReduxSpa/ClientApp/boot-server.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/ReactReduxSpa/ClientApp/boot-server.tsx b/templates/ReactReduxSpa/ClientApp/boot-server.tsx index 3c2355f..fa3289e 100644 --- a/templates/ReactReduxSpa/ClientApp/boot-server.tsx +++ b/templates/ReactReduxSpa/ClientApp/boot-server.tsx @@ -14,6 +14,11 @@ export default function (params: any): Promise<{ html: string }> { throw error; } + // If it didn't match any route, renderProps will be undefined + if (!renderProps) { + throw new Error(`The location '${ params.url }' doesn't match any route configured in react-router.`); + } + // Build an instance of the application const store = configureStore(); const app = (