Repository: discordjs/discord.js
File: apps/website/src/app/docs/packages/[packageName]/[version]/[[...item]]/page.tsx (TypeScript)

Code before:
	params,
}: {
	readonly params: Promise<{
		readonly item?: string[] | undefined;
		readonly packageName: string;
		readonly version: string;
	}>;
}) {
	const { item, packageName, version } = await params;

	const { entryPoints: parsedEntrypoints, foundItem } = parseDocsPathParams(item);

	if (!foundItem) {
		const hasEntryPoint = PACKAGES_WITH_ENTRY_POINTS.includes(packageName);

		if (hasEntryPoint) {
			return <>Placeholder</>;
		}

		let fileContent: string;

		try {
			fileContent = await readFile(join(process.cwd(), `src/assets/readme/${packageName}/home-README.md`), 'utf8');
		} catch {
			notFound();
		}

		return (
			<div className="prose prose-neutral dark:prose-invert prose-a:[&>img]:inline-block prose-a:[&>img]:m-0 prose-a:[&>img[height='44']]:h-11 prose-p:my-2 prose-pre:py-3 prose-pre:rounded-sm prose-pre:px-0 prose-pre:border prose-pre:border-[#d4d4d4] dark:prose-pre:border-[#404040] prose-code:font-normal prose-a:text-[#5865F2] prose-a:no-underline prose-a:hover:text-[#3d48c3] dark:prose-a:hover:text-[#7782fa] mx-auto max-w-screen-xl px-6 py-6 break-words [&_code_span:last-of-type:empty]:hidden [&_div[align='center']_p_a+a]:ml-2">
				<MDXRemote
					options={{
						mdxOptions: {
							remarkPlugins: [remarkGfm],
							rehypePlugins: [
								[
									rehypeShikiFromHighlighter,
									await getSingletonHighlighter({
										langs: ['typescript', 'javascript', 'shellscript'],
										themes: ['github-light', 'github-dark-dimmed'],
									}),
									{
										themes: {
											light: 'github-light',
											dark: 'github-dark-dimmed',
										},
									},
								],
							],
						},
					}}
					source={fileContent}

Review comment (suggestion):
```suggestion
		} catch (error) {
			if ('code' in error && error.code === 'ENOENT') {
				notFound();
			}

			throw error;
		}
```

actually,
```suggestion
		} catch (error) {
			console.error(error);
			notFound();
		}
```

is also good enough IMO

Code after:
	params,
}: {
	readonly params: Promise<{
		readonly item?: string[] | undefined;
		readonly packageName: string;
		readonly version: string;
	}>;
}) {
	const { item, packageName, version } = await params;

	const { entryPoints: parsedEntrypoints, foundItem } = parseDocsPathParams(item);

	if (!foundItem) {
		const hasEntryPoint = PACKAGES_WITH_ENTRY_POINTS.includes(packageName);

		if (hasEntryPoint) {
			return <>Placeholder</>;
		}

		let fileContent: string;

		try {
			fileContent = await readFile(join(process.cwd(), `src/assets/readme/${packageName}/home-README.md`), 'utf8');
		} catch (error: any) {
			if ('code' in error && error.code === 'ENOENT') {
				notFound();
			}

			throw error;
		}

		return (
			<div className="prose prose-neutral dark:prose-invert prose-a:[&>img]:inline-block prose-a:[&>img]:m-0 prose-a:[&>img[height='44']]:h-11 prose-p:my-2 prose-pre:py-3 prose-pre:rounded-sm prose-pre:px-0 prose-pre:border prose-pre:border-[#d4d4d4] dark:prose-pre:border-[#404040] prose-code:font-normal prose-a:text-[#5865F2] prose-a:no-underline prose-a:hover:text-[#3d48c3] dark:prose-a:hover:text-[#7782fa] mx-auto max-w-screen-xl px-6 py-6 break-words [&_code_span:last-of-type:empty]:hidden [&_div[align='center']_p_a+a]:ml-2">
				<MDXRemote
					options={{
						mdxOptions: {
							remarkPlugins: [remarkGfm],
							rehypePlugins: [
								[
									rehypeShikiFromHighlighter,
									await getSingletonHighlighter({
										langs: ['typescript', 'javascript', 'shellscript'],
										themes: ['github-light', 'github-dark-dimmed'],
									}),
									{
										themes: {
											light: 'github-light',
											dark: 'github-dark-dimmed',
										},
									},
								],