Skip to content

Commit

Permalink
wip: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 15, 2024
1 parent 770b456 commit 065b0c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions viteroll/examples/ssr-simple/src/entry-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const handler: Connect.SimpleHandleFunction = (req, res) => {
const url = new URL(req.url ?? "/", "https://vite.dev");
console.log(`[SSR] ${req.method} ${url.pathname}`);
if (url.pathname === "/crash-ssr") {
throw new Error("crash-ssr");
const error = new Error("crash-ssr");
console.error(error);
throw error;
}
res.setHeader("content-type", "text/html");
// TODO: transformIndexHtml?
Expand All @@ -15,7 +17,8 @@ const handler: Connect.SimpleHandleFunction = (req, res) => {
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
Test SSR
<h4>Rolldown SSR</h4>
<a href="/crash-ssr">/crash-ssr</a>
</body>
</html>
`);
Expand Down

0 comments on commit 065b0c9

Please sign in to comment.