Skip to content

Commit 6ba3a2a

Browse files
committedAug 22, 2023
fix: show RenderErrorPage() deprecation warning more prominently
1 parent e09053e commit 6ba3a2a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
 

‎test-e2e.config.mjs

+12
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function getCiJobs() {
6767

6868
function tolerateError({ logSource, logText }) {
6969
return (
70+
isRenderErrorPageDeprecationWarning() ||
7071
isSlowHookWarning() ||
7172
isNoErrorPageWarning() ||
7273
isServiceExit() ||
@@ -83,6 +84,17 @@ function tolerateError({ logSource, logText }) {
8384
isNodeExperimentalEsmLoader()
8485
)
8586

87+
function isRenderErrorPageDeprecationWarning() {
88+
return (
89+
logSource === 'stderr' &&
90+
logText.includes('[Warning]') &&
91+
logText.includes('throw RenderErrorPage()') &&
92+
logText.includes(
93+
'is deprecated and will be removed in the next major release. Use `throw render()` or `throw redirect()` instead'
94+
)
95+
)
96+
}
97+
8698
// [vite-plugin-ssr@0.4.42][Warning] The onBeforeRender() hook of /pages/star-wars/index/index.page.server.ts is taking more than 4 seconds
8799
function isSlowHookWarning() {
88100
return (

‎vite-plugin-ssr/shared/route/abort.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function RenderErrorPage({ pageContext = {} }: { pageContext?: Record<string, un
175175
assertWarning(
176176
false,
177177
'`throw RenderErrorPage()` is deprecated and will be removed in the next major release. Use `throw render()` or `throw redirect()` instead, see https://vite-plugin-ssr.com/render',
178-
{ onlyOnce: true }
178+
{ onlyOnce: false }
179179
)
180180
let abortStatusCode: 404 | 500 = 404
181181
let abortReason = 'Page Not Found'

0 commit comments

Comments
 (0)
Please sign in to comment.