diff --git a/frontend/src/pages/_app.tsx b/frontend/src/pages/_app.tsx index 39c6b4219..c6829bfdf 100644 --- a/frontend/src/pages/_app.tsx +++ b/frontend/src/pages/_app.tsx @@ -13,10 +13,13 @@ import { BaseHead } from '../components/layout/base-head' import { UiNotificationBoundary } from '../components/notifications/ui-notification-boundary' import { StoreProvider } from '../redux/store-provider' import { BaseUrlFromEnvExtractor } from '../utils/base-url-from-env-extractor' +import { configureLuxon } from '../utils/configure-luxon' import { ExpectedOriginBoundary } from '../utils/uri-origin-boundary' import type { AppInitialProps, AppProps } from 'next/app' import React from 'react' +configureLuxon() + interface AppPageProps { baseUrls: BaseUrls | undefined } diff --git a/frontend/src/utils/configure-luxon.ts b/frontend/src/utils/configure-luxon.ts new file mode 100644 index 000000000..e2bb57ae1 --- /dev/null +++ b/frontend/src/utils/configure-luxon.ts @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) + * + * SPDX-License-Identifier: AGPL-3.0-only + */ +import { Settings } from 'luxon' + +export const configureLuxon = () => { + Settings.throwOnInvalid = true +} + +declare module 'luxon' { + interface TSSettings { + throwOnInvalid: true + } +}