Skip to content

Commit

Permalink
move check inside component to fix building in pipeline without env s…
Browse files Browse the repository at this point in the history
…ettings
  • Loading branch information
toggm committed Jan 9, 2025
1 parent 255fc77 commit 6b9f9e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/cv/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import { headers } from 'next/headers';
import * as process from 'node:process';
import { PRINTER_HEADER_KEY } from '@/payload/utilities/constants';

if (!process.env.PRINTER_SECRET) {
throw new Error('PDF Printer: Printer secret not found. Aborting..');
}

type Args = {
params: Promise<{
id: string;
Expand Down Expand Up @@ -71,6 +67,10 @@ const hasLexicalNodes = (data: PayloadLexicalReactRendererContent) => {
};

const Page = async ({ params, searchParams }: Args) => {
if (!process.env.PRINTER_SECRET) {
throw new Error('PDF Printer: Printer secret not found. Aborting..');
}

const query = {
params: await params,
searchParams: await searchParams,
Expand Down

0 comments on commit 6b9f9e9

Please sign in to comment.