Skip to content

Commit

Permalink
fix: show error if vite client cannot be loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jun 8, 2024
1 parent feae09f commit 609d437
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/vite/src/node/server/middlewares/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export function errorMiddleware(
</script>
</head>
<body>
<h1>Internal Server Error</h1>
<pre>${err.stack?.replace(/</g, '&lt;')}</pre>
</body>
</html>
`)
Expand Down
2 changes: 1 addition & 1 deletion playground/html/__tests__/html.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ describe.runIf(isServe)('invalid', () => {
const errorOverlay = await page.waitForSelector('vite-error-overlay')
expect(errorOverlay).toBeTruthy()

await page.click('html')
await page.click('html', { position: { x: 50, y: 50 } })
const isVisbleOverlay = await errorOverlay.isVisible()
expect(isVisbleOverlay).toBeFalsy()
})
Expand Down

0 comments on commit 609d437

Please sign in to comment.