Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

Commit 8846f73

Browse files
authored
Merge pull request #388 from NDLANO/no-crashing-on-403
Add staticroute for error page
2 parents a61ca1f + cb8f46b commit 8846f73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/server/routes/errorRoute.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import React from "react";
1010
import { Provider } from "react-redux";
11+
import { StaticRouter } from "react-router";
1112
import { INTERNAL_SERVER_ERROR } from "http-status";
1213
import ErrorPage from "../../errorPage/ErrorPage";
1314
import { getLocaleInfoFromPath } from "../../locale/configureLocale";
@@ -30,7 +31,9 @@ async function doRenderError(req, status = INTERNAL_SERVER_ERROR) {
3031
const context = { status };
3132
const Page = (
3233
<Provider store={store} locale={locale}>
33-
<ErrorPage locale={locale} />
34+
<StaticRouter>
35+
<ErrorPage locale={locale} />
36+
</StaticRouter>
3437
</Provider>
3538
);
3639

0 commit comments

Comments
 (0)