From 7095b45a371ac16a49140dd10c76fb41f2b520ec Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Fri, 27 Jan 2023 20:11:18 -0800 Subject: [PATCH] Added an error boundary and set the remix-typedjson version to 0.1.3 --- apps/webapp/app/root.tsx | 26 ++++++++++++++++++++++++++ apps/webapp/package.json | 8 ++++---- pnpm-lock.yaml | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/apps/webapp/app/root.tsx b/apps/webapp/app/root.tsx index 1f51c81cd6f..83b085f73e4 100644 --- a/apps/webapp/app/root.tsx +++ b/apps/webapp/app/root.tsx @@ -22,6 +22,7 @@ import { withSentry } from "@sentry/remix"; import { env } from "./env.server"; import { typedjson, useTypedLoaderData } from "remix-typedjson"; import { PrimaryLink } from "./components/primitives/Buttons"; +import { Body } from "./components/primitives/text/Body"; export const links: LinksFunction = () => { return [ @@ -78,6 +79,31 @@ export function CatchBoundary() { ); } +export function ErrorBoundary({ error }: { error: any }) { + console.error(error); + return ( + + + Oops! + + + + +
+
+

Oh no!

+ {JSON.stringify(error)} + + Back home + +
+ +
+ + + ); +} + function App() { const { toastMessage, posthogProjectKey, user } = useTypedLoaderData(); diff --git a/apps/webapp/package.json b/apps/webapp/package.json index 3324602ee55..320ae8bad35 100644 --- a/apps/webapp/package.json +++ b/apps/webapp/package.json @@ -63,10 +63,9 @@ "@tailwindcss/forms": "^0.5.2", "@tanstack/react-table": "^8.0.0-alpha.87", "@trigger.dev/common-schemas": "workspace:*", + "@trigger.dev/integrations": "workspace:*", "@trigger.dev/providers": "workspace:*", "@trigger.dev/sdk": "workspace:*", - "@trigger.dev/integrations": "workspace:*", - "internal-bridge": "workspace:*", "@uiw/react-codemirror": "^4.13.2", "bcryptjs": "^2.4.3", "classnames": "^2.3.1", @@ -81,6 +80,7 @@ "emails": "workspace:*", "express": "^4.18.1", "humanize-duration": "^3.27.3", + "internal-bridge": "workspace:*", "internal-integrations": "workspace:*", "internal-platform": "workspace:*", "internal-pulsar": "workspace:*", @@ -112,7 +112,7 @@ "remix-auth": "^3.2.2", "remix-auth-email-link": "^1.4.2", "remix-auth-github": "^1.1.1", - "remix-typedjson": "^0.1.3", + "remix-typedjson": "~0.1.3", "remix-utils": "^3.4.0", "slug": "^6.0.0", "tiny-invariant": "^1.2.0", @@ -186,4 +186,4 @@ "engines": { "node": ">=16.0.0" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 36d67f12f19..72d809741d2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,7 +164,7 @@ importers: remix-auth: ^3.2.2 remix-auth-email-link: ^1.4.2 remix-auth-github: ^1.1.1 - remix-typedjson: ^0.1.3 + remix-typedjson: ~0.1.3 remix-utils: ^3.4.0 slug: ^6.0.0 start-server-and-test: ^1.14.0