Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix capitalization in formatted server errors #44798

Merged
merged 3 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/src/lib/format-server-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function formatServerError(error: Error): void {
error,
`${error.message}

This might be caused by a React Class component being rendered in a server component, React Class components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component`
This might be caused by a React Class Component being rendered in a Server Component, React Class Components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component`
)
return
}
Expand Down
12 changes: 6 additions & 6 deletions test/development/acceptance-app/server-components.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ createNextDescribe(
.waitForElementByCss('#nextjs__container_errors_desc')
.text()
).toContain(
'This might be caused by a React Class component being rendered in a server component'
'This might be caused by a React Class Component being rendered in a Server Component'
)
return 'success'
}, 'success')

expect(next.cliOutput).toContain(
'This might be caused by a React Class component being rendered in a server component'
'This might be caused by a React Class Component being rendered in a Server Component'
)

await cleanup()
Expand Down Expand Up @@ -384,13 +384,13 @@ createNextDescribe(
.waitForElementByCss('#nextjs__container_errors_desc')
.text()
).toContain(
'This might be caused by a React Class component being rendered in a server component'
'This might be caused by a React Class Component being rendered in a Server Component'
)
return 'success'
}, 'success')

expect(next.cliOutput).toContain(
'This might be caused by a React Class component being rendered in a server component'
'This might be caused by a React Class Component being rendered in a Server Component'
)

await cleanup()
Expand Down Expand Up @@ -437,13 +437,13 @@ createNextDescribe(
.waitForElementByCss('#nextjs__container_errors_desc')
.text()
).toContain(
'This might be caused by a React Class component being rendered in a server component'
'This might be caused by a React Class Component being rendered in a Server Component'
)
return 'success'
}, 'success')

expect(next.cliOutput).toContain(
'This might be caused by a React Class component being rendered in a server component'
'This might be caused by a React Class Component being rendered in a Server Component'
)

await cleanup()
Expand Down