Skip to content

Commit

Permalink
test vercel 500 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
charislam committed Jul 3, 2024
1 parent 5a272dc commit 6f2f96a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 8 additions & 1 deletion apps/docs/app/guides/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { notFoundLink } from '~/features/recommendations/NotFound.utils'
type Params = { slug: string[] }

const GuidePage = async ({ params }: { params: Params }) => {
console.log('GUIDE PAGE')
let notFound = false
let data: Awaited<ReturnType<typeof getGuidesMarkdown>>

Expand All @@ -18,15 +19,21 @@ const GuidePage = async ({ params }: { params: Params }) => {
* we cannot redirect within the catch block.
*/
try {
console.log('PRE GET MARKDOWN')
data = await getGuidesMarkdown(params)
console.log('POST GET MARKDOWN')
} catch {
console.log('CATCH')
notFound = true
}

if (notFound) {
redirect(notFoundLink(params.slug.join('/')))
console.log('NOT FOUND REDIRECT')
return redirect(notFoundLink(params.slug.join('/')))
}

console.log('POST NOT FOUND REDIRECT')

return <GuideTemplate {...data!} />
}

Expand Down
6 changes: 2 additions & 4 deletions apps/docs/features/docs/mdx.shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import Link from 'next/link'
import { GlassPanel } from 'ui-patterns/GlassPanel'
import { IconPanel } from 'ui-patterns/IconPanel'
import SqlToRest from 'ui-patterns/SqlToRest'
import { ThemeImage } from 'ui-patterns/ThemeImage'
import { Button } from 'ui'
import { Admonition } from 'ui'
import { Admonition, Button, Image } from 'ui'
import { Heading } from 'ui/src/components/CustomHTMLElements'
import { AppleSecretGenerator } from '~/components/AppleSecretGenerator'
import AuthProviders from '~/components/AuthProviders'
Expand Down Expand Up @@ -57,7 +55,7 @@ const components = {
IconArrowDown: ArrowDown,
IconCheck: Check,
IconPanel,
Image: (props: any) => <ThemeImage fill className="object-contain" {...props} />,
Image: (props: any) => <Image fill className="object-contain" {...props} />,
JwtGenerator,
KotlinProjectSetup,
Link,
Expand Down

0 comments on commit 6f2f96a

Please sign in to comment.