Skip to content

Commit

Permalink
Remove error boundary from robots.txt skeleton (#1492)
Browse files Browse the repository at this point in the history
* Remove error boundary from robots.txt skeleton

* Add changeset
  • Loading branch information
andrewcohen authored Nov 8, 2023
1 parent 9b4f453 commit 26c969b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
6 changes: 6 additions & 0 deletions .changeset/bright-steaks-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/cli-hydrogen': patch
'@shopify/create-hydrogen': patch
---

Remove error boundary from robots.txt in hydrogen template
27 changes: 0 additions & 27 deletions templates/skeleton/app/routes/[robots.txt].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,6 @@ export async function loader({request, context}: LoaderFunctionArgs) {
});
}

export function ErrorBoundary() {
const error = useRouteError();

if (isRouteErrorResponse(error)) {
return (
<div>
<h1>Oops</h1>
<p>Status: {error.status}</p>
<p>{error.data.message}</p>
</div>
);
}

let errorMessage = 'Unknown error';
if (error instanceof Error) {
errorMessage = error.message;
}

return (
<div>
<h1>Uh oh ...</h1>
<p>Something went wrong.</p>
<pre>{errorMessage}</pre>
</div>
);
}

function robotsTxtData({url, shopId}: {shopId?: string; url?: string}) {
const sitemapUrl = url ? `${url}/sitemap.xml` : undefined;

Expand Down

0 comments on commit 26c969b

Please sign in to comment.